diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 00:14:57 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 00:14:57 +0400 |
commit | 6da6dc2380c3cfe8d6b59d7c3c55fdd7a521fe6c (patch) | |
tree | 152566bea1fc5593ef58deec450e0a499776d8c4 /include | |
parent | 8c55f1463c1fd318d5e785f02b80bcc32176d342 (diff) | |
parent | b8d26b3be8b33682cf163274ed07479a70554633 (diff) | |
download | linux-6da6dc2380c3cfe8d6b59d7c3c55fdd7a521fe6c.tar.xz |
Merge branch 'for-next-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Pull SCSI target update from Nicholas Bellinger:
"The highlights this round include:
- Add fileio support for WRITE_SAME w/ UNMAP=1 discard (asias)
- Add fileio support for UNMAP discard (asias)
- Add tcm_vhost hotplug support to work with upstream QEMU
vhost-scsi-pci code (asias + mst)
- Check for aborted sequence in tcm_fc response path (mdr)
- Add initial iscsit_transport support into iscsi-target code (nab)
- Refactor iscsi-target RX PDU logic + export request PDU handling
(nab)
- Refactor iscsi-target TX queue logic + export response PDU creation
(nab)
- Add new iSCSI Extentions for RDMA (ISER) target driver (Or + nab)
The biggest changes revolve around iscsi-target refactoring in order
to support the iser-target driver. This includes the conversion of
the iscsi-target data-path to use modern se_cmd->cmd_kref counting,
and allowing transport independent aspects of RX/TX PDU
request/response handling be shared across existing traditional
iscsi-target code, and the new iser-target code.
Thanks to Or Gerlitz + Mellanox for supporting the iser-target
development effort!"
* 'for-next-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (25 commits)
iser-target: Add iSCSI Extensions for RDMA (iSER) target driver
tcm_vhost: Enable VIRTIO_SCSI_F_HOTPLUG
tcm_vhost: Add ioctl to get and set events missed flag
tcm_vhost: Add hotplug/hotunplug support
tcm_vhost: Refactor the lock nesting rule
tcm_fc: Check for aborted sequence
iscsi-target: Add iser network portal attribute
iscsi-target: Refactor TX queue logic + export response PDU creation
iscsi-target: Refactor RX PDU logic + export request PDU handling
iscsi-target: Add per transport iscsi_cmd alloc/free
iscsi-target: Add iser-target parameter keys + setup during login
iscsi-target: Initial traditional TCP conversion to iscsit_transport
iscsi-target: Add iscsit_transport API template
target: Add export of target_get_sess_cmd symbol
target: Change default sense key of NOT_READY
target/file: Set is_nonrot attribute
target: Add sbc_execute_unmap() helper
target/iblock: Add iblock_do_unmap() helper
target/file: Add fd_do_unmap() helper
target/file: Add UNMAP emulation support
...
Diffstat (limited to 'include')
-rw-r--r-- | include/target/iscsi/iscsi_transport.h | 83 | ||||
-rw-r--r-- | include/target/target_core_backend.h | 4 | ||||
-rw-r--r-- | include/target/target_core_fabric.h | 2 |
3 files changed, 88 insertions, 1 deletions
diff --git a/include/target/iscsi/iscsi_transport.h b/include/target/iscsi/iscsi_transport.h new file mode 100644 index 000000000000..23a87d0cd72c --- /dev/null +++ b/include/target/iscsi/iscsi_transport.h @@ -0,0 +1,83 @@ +#include <linux/module.h> +#include <linux/list.h> +#include "../../../drivers/target/iscsi/iscsi_target_core.h" + +struct iscsit_transport { +#define ISCSIT_TRANSPORT_NAME 16 + char name[ISCSIT_TRANSPORT_NAME]; + int transport_type; + struct module *owner; + struct list_head t_node; + int (*iscsit_setup_np)(struct iscsi_np *, struct __kernel_sockaddr_storage *); + int (*iscsit_accept_np)(struct iscsi_np *, struct iscsi_conn *); + void (*iscsit_free_np)(struct iscsi_np *); + void (*iscsit_free_conn)(struct iscsi_conn *); + struct iscsi_cmd *(*iscsit_alloc_cmd)(struct iscsi_conn *, gfp_t); + int (*iscsit_get_login_rx)(struct iscsi_conn *, struct iscsi_login *); + int (*iscsit_put_login_tx)(struct iscsi_conn *, struct iscsi_login *, u32); + int (*iscsit_immediate_queue)(struct iscsi_conn *, struct iscsi_cmd *, int); + int (*iscsit_response_queue)(struct iscsi_conn *, struct iscsi_cmd *, int); + int (*iscsit_get_dataout)(struct iscsi_conn *, struct iscsi_cmd *, bool); + int (*iscsit_queue_data_in)(struct iscsi_conn *, struct iscsi_cmd *); + int (*iscsit_queue_status)(struct iscsi_conn *, struct iscsi_cmd *); +}; + +/* + * From iscsi_target_transport.c + */ + +extern int iscsit_register_transport(struct iscsit_transport *); +extern void iscsit_unregister_transport(struct iscsit_transport *); +extern struct iscsit_transport *iscsit_get_transport(int); +extern void iscsit_put_transport(struct iscsit_transport *); + +/* + * From iscsi_target.c + */ +extern int iscsit_add_reject_from_cmd(u8, int, int, unsigned char *, + struct iscsi_cmd *); +extern int iscsit_setup_scsi_cmd(struct iscsi_conn *, struct iscsi_cmd *, + unsigned char *); +extern void iscsit_set_unsoliticed_dataout(struct iscsi_cmd *); +extern int iscsit_process_scsi_cmd(struct iscsi_conn *, struct iscsi_cmd *, + struct iscsi_scsi_req *); +extern int iscsit_check_dataout_hdr(struct iscsi_conn *, unsigned char *, + struct iscsi_cmd **); +extern int iscsit_check_dataout_payload(struct iscsi_cmd *, struct iscsi_data *, + bool); +extern int iscsit_handle_nop_out(struct iscsi_conn *, struct iscsi_cmd *, + unsigned char *); +extern int iscsit_handle_logout_cmd(struct iscsi_conn *, struct iscsi_cmd *, + unsigned char *); +extern int iscsit_handle_task_mgt_cmd(struct iscsi_conn *, struct iscsi_cmd *, + unsigned char *); +extern void iscsit_build_rsp_pdu(struct iscsi_cmd *, struct iscsi_conn *, + bool, struct iscsi_scsi_rsp *); +extern void iscsit_build_nopin_rsp(struct iscsi_cmd *, struct iscsi_conn *, + struct iscsi_nopin *, bool); +extern void iscsit_build_task_mgt_rsp(struct iscsi_cmd *, struct iscsi_conn *, + struct iscsi_tm_rsp *); +extern void iscsit_build_reject(struct iscsi_cmd *, struct iscsi_conn *, + struct iscsi_reject *); +extern int iscsit_build_logout_rsp(struct iscsi_cmd *, struct iscsi_conn *, + struct iscsi_logout_rsp *); +extern int iscsit_logout_post_handler(struct iscsi_cmd *, struct iscsi_conn *); +/* + * From iscsi_target_device.c + */ +extern void iscsit_increment_maxcmdsn(struct iscsi_cmd *, struct iscsi_session *); +/* + * From iscsi_target_erl1.c + */ +extern void iscsit_stop_dataout_timer(struct iscsi_cmd *); + +/* + * From iscsi_target_tmr.c + */ +extern int iscsit_tmr_post_handler(struct iscsi_cmd *, struct iscsi_conn *); + +/* + * From iscsi_target_util.c + */ +extern struct iscsi_cmd *iscsit_allocate_cmd(struct iscsi_conn *, gfp_t); +extern int iscsit_sequence_cmd(struct iscsi_conn *, struct iscsi_cmd *, __be32); diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index b128c20770bc..ffa2696d64dc 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h @@ -60,6 +60,10 @@ sense_reason_t sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops); u32 sbc_get_device_rev(struct se_device *dev); u32 sbc_get_device_type(struct se_device *dev); sector_t sbc_get_write_same_sectors(struct se_cmd *cmd); +sense_reason_t sbc_execute_unmap(struct se_cmd *cmd, + sense_reason_t (*do_unmap_fn)(struct se_cmd *cmd, void *priv, + sector_t lba, sector_t nolb), + void *priv); void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index aaa1ee6ab391..ba3471b73c07 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -120,7 +120,7 @@ bool transport_wait_for_tasks(struct se_cmd *); int transport_check_aborted_status(struct se_cmd *, int); int transport_send_check_condition_and_sense(struct se_cmd *, sense_reason_t, int); - +int target_get_sess_cmd(struct se_session *, struct se_cmd *, bool); int target_put_sess_cmd(struct se_session *, struct se_cmd *); void target_sess_cmd_list_set_waiting(struct se_session *); void target_wait_for_sess_cmds(struct se_session *, int); |