diff options
| author | Christoph Hellwig <hch@lst.de> | 2016-05-03 12:01:10 -0400 |
|---|---|---|
| committer | Doug Ledford <dledford@redhat.com> | 2016-05-13 13:37:19 -0400 |
| commit | e64aa657c3d0dae84c2ccc166f6fe25b7d1d28c6 (patch) | |
| tree | 898c3e12c36c5d5b561aacb0b8fa2e9804714e1a /include/target | |
| parent | a060b5629ab066dd1d321430eeb96f70939a1790 (diff) | |
target: enhance and export target_alloc_sgl/target_free_sgl
The SRP target driver will need to allocate and chain it's own SGLs soon.
For this export target_alloc_sgl, and add a new argument to it so that it
can allocate an additional chain entry that doesn't point to a page. Also
export transport_free_sgl after renaming it to target_free_sgl to free
these SGLs again.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/target')
| -rw-r--r-- | include/target/target_core_backend.h | 1 | ||||
| -rw-r--r-- | include/target/target_core_fabric.h | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index 28ee5c2e6bcd..d8ab5101fad5 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h | |||
| @@ -85,7 +85,6 @@ extern struct configfs_attribute *passthrough_attrib_attrs[]; | |||
| 85 | void *transport_kmap_data_sg(struct se_cmd *); | 85 | void *transport_kmap_data_sg(struct se_cmd *); |
| 86 | void transport_kunmap_data_sg(struct se_cmd *); | 86 | void transport_kunmap_data_sg(struct se_cmd *); |
| 87 | /* core helpers also used by xcopy during internal command setup */ | 87 | /* core helpers also used by xcopy during internal command setup */ |
| 88 | int target_alloc_sgl(struct scatterlist **, unsigned int *, u32, bool); | ||
| 89 | sense_reason_t transport_generic_map_mem_to_cmd(struct se_cmd *, | 88 | sense_reason_t transport_generic_map_mem_to_cmd(struct se_cmd *, |
| 90 | struct scatterlist *, u32, struct scatterlist *, u32); | 89 | struct scatterlist *, u32, struct scatterlist *, u32); |
| 91 | 90 | ||
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 8ff6d40a294f..78d88f03b296 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h | |||
| @@ -185,6 +185,10 @@ int core_tpg_set_initiator_node_tag(struct se_portal_group *, | |||
| 185 | int core_tpg_register(struct se_wwn *, struct se_portal_group *, int); | 185 | int core_tpg_register(struct se_wwn *, struct se_portal_group *, int); |
| 186 | int core_tpg_deregister(struct se_portal_group *); | 186 | int core_tpg_deregister(struct se_portal_group *); |
| 187 | 187 | ||
| 188 | int target_alloc_sgl(struct scatterlist **sgl, unsigned int *nents, | ||
| 189 | u32 length, bool zero_page, bool chainable); | ||
| 190 | void target_free_sgl(struct scatterlist *sgl, int nents); | ||
| 191 | |||
| 188 | /* | 192 | /* |
| 189 | * The LIO target core uses DMA_TO_DEVICE to mean that data is going | 193 | * The LIO target core uses DMA_TO_DEVICE to mean that data is going |
| 190 | * to the target (eg handling a WRITE) and DMA_FROM_DEVICE to mean | 194 | * to the target (eg handling a WRITE) and DMA_FROM_DEVICE to mean |
