diff options
author | Andy Grover <agrover@redhat.com> | 2011-07-20 19:13:28 +0000 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-07-22 09:37:48 +0000 |
commit | 05d1c7c0d0db4cc25548d9aadebb416888a82327 (patch) | |
tree | 290243526d188a7f6a683b0e13a63c7207471fa1 /include/target/target_core_transport.h | |
parent | e22a7f075226c51f3f71b922e9eeb4f99fac1475 (diff) | |
download | linux-stable-05d1c7c0d0db4cc25548d9aadebb416888a82327.tar.gz linux-stable-05d1c7c0d0db4cc25548d9aadebb416888a82327.tar.bz2 linux-stable-05d1c7c0d0db4cc25548d9aadebb416888a82327.zip |
target: Make all control CDBs scatter-gather
Previously, some control CDBs did not allocate memory in pages for their
data buffer, but just did a kmalloc. This patch makes all cdbs allocate
pages.
This has the benefit of streamlining some paths that had to behave
differently when we used two allocation methods. The downside is that
all accesses to the data buffer need to kmap it before use, and need to
handle data in page-sized chunks if more than a page is needed for a given
command's data buffer.
Finally, note that cdbs with no data buffers are handled a little
differently. Before, SCSI_NON_DATA_CDBs would not call get_mem at all
(they'd be in the final else in transport_allocate_resources) but now
these will make it into generic_get_mem, but just not allocate any
buffers.
Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target/target_core_transport.h')
-rw-r--r-- | include/target/target_core_transport.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h index b27ce1af698b..123df9238c68 100644 --- a/include/target/target_core_transport.h +++ b/include/target/target_core_transport.h @@ -165,6 +165,8 @@ extern void transport_init_se_cmd(struct se_cmd *, struct target_core_fabric_ops *, struct se_session *, u32, int, int, unsigned char *); +void *transport_kmap_first_data_page(struct se_cmd *cmd); +void transport_kunmap_first_data_page(struct se_cmd *cmd); extern void transport_free_se_cmd(struct se_cmd *); extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *); extern int transport_generic_handle_cdb(struct se_cmd *); @@ -237,10 +239,6 @@ struct se_subsystem_api { */ int (*cdb_none)(struct se_task *); /* - * For SCF_SCSI_CONTROL_NONSG_IO_CDB - */ - int (*map_task_non_SG)(struct se_task *); - /* * For SCF_SCSI_DATA_SG_IO_CDB and SCF_SCSI_CONTROL_SG_IO_CDB */ int (*map_task_SG)(struct se_task *); |