]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: target/core: Remove the write_pending_status() callback function
authorBart Van Assche <bvanassche@acm.org>
Fri, 25 Jan 2019 18:34:43 +0000 (10:34 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 5 Feb 2019 02:23:59 +0000 (21:23 -0500)
Due to the patch that makes TMF handling synchronous the
write_pending_status() callback function is no longer called.  Hence remove
it.

Acked-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Andy Grover <agrover@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Mike Christie <mchristi@redhat.com>
Cc: Himanshu Madhani <himanshu.madhani@qlogic.com>
Cc: Quinn Tran <quinn.tran@qlogic.com>
Cc: Saurav Kashyap <saurav.kashyap@qlogic.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
16 files changed:
Documentation/target/tcm_mod_builder.py
drivers/infiniband/ulp/srpt/ib_srpt.c
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
drivers/scsi/qla2xxx/tcm_qla2xxx.c
drivers/target/iscsi/iscsi_target_configfs.c
drivers/target/loopback/tcm_loop.c
drivers/target/sbp/sbp_target.c
drivers/target/target_core_configfs.c
drivers/target/target_core_xcopy.c
drivers/target/tcm_fc/tcm_fc.h
drivers/target/tcm_fc/tfc_cmd.c
drivers/target/tcm_fc/tfc_conf.c
drivers/usb/gadget/function/f_tcm.c
drivers/vhost/scsi.c
drivers/xen/xen-scsiback.c
include/target/target_core_fabric.h

index 94bf6944bb1e412b85f649aab136155052092e29..95d6e31f1e3a14ee2d3c180d99120109544ced38 100755 (executable)
@@ -297,7 +297,6 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
        buf += "        .sess_get_index                 = " + fabric_mod_name + "_sess_get_index,\n"
        buf += "        .sess_get_initiator_sid         = NULL,\n"
        buf += "        .write_pending                  = " + fabric_mod_name + "_write_pending,\n"
-       buf += "        .write_pending_status           = " + fabric_mod_name + "_write_pending_status,\n"
        buf += "        .set_default_node_attributes    = " + fabric_mod_name + "_set_default_node_attrs,\n"
        buf += "        .get_cmd_state                  = " + fabric_mod_name + "_get_cmd_state,\n"
        buf += "        .queue_data_in                  = " + fabric_mod_name + "_queue_data_in,\n"
@@ -479,13 +478,6 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
                        buf += "}\n\n"
                        bufi += "int " + fabric_mod_name + "_write_pending(struct se_cmd *);\n"
 
-               if re.search('write_pending_status\)\(', fo):
-                       buf += "int " + fabric_mod_name + "_write_pending_status(struct se_cmd *se_cmd)\n"
-                       buf += "{\n"
-                       buf += "        return 0;\n"
-                       buf += "}\n\n"
-                       bufi += "int " + fabric_mod_name + "_write_pending_status(struct se_cmd *);\n"
-
                if re.search('set_default_node_attributes\)\(', fo):
                        buf += "void " + fabric_mod_name + "_set_default_node_attrs(struct se_node_acl *nacl)\n"
                        buf += "{\n"
index e9c336cff8f58ef7e823049d4c2f55dd7e40a62a..8cee8c6c6be9afbc827ef940d6fab94ecab466bf 100644 (file)
@@ -2703,14 +2703,6 @@ static int srpt_rdma_cm_handler(struct rdma_cm_id *cm_id,
        return ret;
 }
 
-static int srpt_write_pending_status(struct se_cmd *se_cmd)
-{
-       struct srpt_send_ioctx *ioctx;
-
-       ioctx = container_of(se_cmd, struct srpt_send_ioctx, cmd);
-       return ioctx->state == SRPT_STATE_NEED_DATA;
-}
-
 /*
  * srpt_write_pending - Start data transfer from initiator to target (write).
  */
@@ -3806,7 +3798,6 @@ static const struct target_core_fabric_ops srpt_template = {
        .sess_get_index                 = srpt_sess_get_index,
        .sess_get_initiator_sid         = NULL,
        .write_pending                  = srpt_write_pending,
-       .write_pending_status           = srpt_write_pending_status,
        .set_default_node_attributes    = srpt_set_default_node_attrs,
        .get_cmd_state                  = srpt_get_tcm_cmd_state,
        .queue_data_in                  = srpt_queue_data_in,
index cc9cae469c4b33fe664e54e2fe2454087e0190ce..7ca277e28d63191aa6901547bf56342a01d9a34f 100644 (file)
@@ -3788,11 +3788,6 @@ static int ibmvscsis_write_pending(struct se_cmd *se_cmd)
        return 0;
 }
 
-static int ibmvscsis_write_pending_status(struct se_cmd *se_cmd)
-{
-       return 0;
-}
-
 static void ibmvscsis_set_default_node_attrs(struct se_node_acl *nacl)
 {
 }
@@ -4053,7 +4048,6 @@ static const struct target_core_fabric_ops ibmvscsis_ops = {
        .release_cmd                    = ibmvscsis_release_cmd,
        .sess_get_index                 = ibmvscsis_sess_get_index,
        .write_pending                  = ibmvscsis_write_pending,
-       .write_pending_status           = ibmvscsis_write_pending_status,
        .set_default_node_attributes    = ibmvscsis_set_default_node_attrs,
        .get_cmd_state                  = ibmvscsis_get_cmd_state,
        .queue_data_in                  = ibmvscsis_queue_data_in,
index 283e6b80abb5a867b7da278cea4744f9349b3f9d..8a3075d17c63ccbd9a617b754f51b343b3abbc33 100644 (file)
@@ -420,26 +420,6 @@ static int tcm_qla2xxx_write_pending(struct se_cmd *se_cmd)
        return qlt_rdy_to_xfer(cmd);
 }
 
-static int tcm_qla2xxx_write_pending_status(struct se_cmd *se_cmd)
-{
-       unsigned long flags;
-       /*
-        * Check for WRITE_PENDING status to determine if we need to wait for
-        * CTIO aborts to be posted via hardware in tcm_qla2xxx_handle_data().
-        */
-       spin_lock_irqsave(&se_cmd->t_state_lock, flags);
-       if (se_cmd->t_state == TRANSPORT_WRITE_PENDING ||
-           se_cmd->t_state == TRANSPORT_COMPLETE_QF_WP) {
-               spin_unlock_irqrestore(&se_cmd->t_state_lock, flags);
-               wait_for_completion_timeout(&se_cmd->t_transport_stop_comp,
-                                               50);
-               return 0;
-       }
-       spin_unlock_irqrestore(&se_cmd->t_state_lock, flags);
-
-       return 0;
-}
-
 static void tcm_qla2xxx_set_default_node_attrs(struct se_node_acl *nacl)
 {
        return;
@@ -537,15 +517,6 @@ static void tcm_qla2xxx_handle_data_work(struct work_struct *work)
 
        cmd->qpair->tgt_counters.qla_core_ret_ctio++;
        if (!cmd->write_data_transferred) {
-               /*
-                * Check if se_cmd has already been aborted via LUN_RESET, and
-                * waiting upon completion in tcm_qla2xxx_write_pending_status()
-                */
-               if (cmd->se_cmd.transport_state & CMD_T_ABORTED) {
-                       complete(&cmd->se_cmd.t_transport_stop_comp);
-                       return;
-               }
-
                switch (cmd->dif_err_code) {
                case DIF_ERR_GRD:
                        cmd->se_cmd.pi_err =
@@ -1902,7 +1873,6 @@ static const struct target_core_fabric_ops tcm_qla2xxx_ops = {
        .sess_get_index                 = tcm_qla2xxx_sess_get_index,
        .sess_get_initiator_sid         = NULL,
        .write_pending                  = tcm_qla2xxx_write_pending,
-       .write_pending_status           = tcm_qla2xxx_write_pending_status,
        .set_default_node_attributes    = tcm_qla2xxx_set_default_node_attrs,
        .get_cmd_state                  = tcm_qla2xxx_get_cmd_state,
        .queue_data_in                  = tcm_qla2xxx_queue_data_in,
@@ -1943,7 +1913,6 @@ static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = {
        .sess_get_index                 = tcm_qla2xxx_sess_get_index,
        .sess_get_initiator_sid         = NULL,
        .write_pending                  = tcm_qla2xxx_write_pending,
-       .write_pending_status           = tcm_qla2xxx_write_pending_status,
        .set_default_node_attributes    = tcm_qla2xxx_set_default_node_attrs,
        .get_cmd_state                  = tcm_qla2xxx_get_cmd_state,
        .queue_data_in                  = tcm_qla2xxx_queue_data_in,
index a5481dfeae8db2e431ef826d0160e741c71d0aae..cac94c94ef5d4bdd27db52c4a5c4b68cba9040fe 100644 (file)
@@ -1389,18 +1389,6 @@ static int lio_write_pending(struct se_cmd *se_cmd)
        return 0;
 }
 
-static int lio_write_pending_status(struct se_cmd *se_cmd)
-{
-       struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_cmd, se_cmd);
-       int ret;
-
-       spin_lock_bh(&cmd->istate_lock);
-       ret = !(cmd->cmd_flags & ICF_GOT_LAST_DATAOUT);
-       spin_unlock_bh(&cmd->istate_lock);
-
-       return ret;
-}
-
 static int lio_queue_status(struct se_cmd *se_cmd)
 {
        struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_cmd, se_cmd);
@@ -1564,7 +1552,6 @@ const struct target_core_fabric_ops iscsi_ops = {
        .sess_get_index                 = lio_sess_get_index,
        .sess_get_initiator_sid         = lio_sess_get_initiator_sid,
        .write_pending                  = lio_write_pending,
-       .write_pending_status           = lio_write_pending_status,
        .set_default_node_attributes    = lio_set_default_node_attributes,
        .get_cmd_state                  = iscsi_get_cmd_state,
        .queue_data_in                  = lio_queue_data_in,
index 7bd7c0c0db6f17202eb85038af3d6cd19fb9467d..89c6e3719d2b99561a3a044d24e18bf8c7142ce7 100644 (file)
@@ -560,11 +560,6 @@ static int tcm_loop_write_pending(struct se_cmd *se_cmd)
        return 0;
 }
 
-static int tcm_loop_write_pending_status(struct se_cmd *se_cmd)
-{
-       return 0;
-}
-
 static int tcm_loop_queue_data_in(struct se_cmd *se_cmd)
 {
        struct tcm_loop_cmd *tl_cmd = container_of(se_cmd,
@@ -1159,7 +1154,6 @@ static const struct target_core_fabric_ops loop_ops = {
        .release_cmd                    = tcm_loop_release_cmd,
        .sess_get_index                 = tcm_loop_sess_get_index,
        .write_pending                  = tcm_loop_write_pending,
-       .write_pending_status           = tcm_loop_write_pending_status,
        .set_default_node_attributes    = tcm_loop_set_default_node_attributes,
        .get_cmd_state                  = tcm_loop_get_cmd_state,
        .queue_data_in                  = tcm_loop_queue_data_in,
index 08cee13dfb9a7e33ed49021a7c4811eb0ab575f5..b0d3583998f0fba6333073e86e2a32223e29ac55 100644 (file)
@@ -1749,11 +1749,6 @@ static int sbp_write_pending(struct se_cmd *se_cmd)
        return 0;
 }
 
-static int sbp_write_pending_status(struct se_cmd *se_cmd)
-{
-       return 0;
-}
-
 static void sbp_set_default_node_attrs(struct se_node_acl *nacl)
 {
        return;
@@ -2329,7 +2324,6 @@ static const struct target_core_fabric_ops sbp_ops = {
        .release_cmd                    = sbp_release_cmd,
        .sess_get_index                 = sbp_sess_get_index,
        .write_pending                  = sbp_write_pending,
-       .write_pending_status           = sbp_write_pending_status,
        .set_default_node_attributes    = sbp_set_default_node_attrs,
        .get_cmd_state                  = sbp_get_cmd_state,
        .queue_data_in                  = sbp_queue_data_in,
index 72016d0dfca5dcc68483f6bfa1cc90adea2b2480..1124c84a3b7fcbf0d197ce80f8843641795e0695 100644 (file)
@@ -401,10 +401,6 @@ static int target_fabric_tf_ops_check(const struct target_core_fabric_ops *tfo)
                pr_err("Missing tfo->write_pending()\n");
                return -EINVAL;
        }
-       if (!tfo->write_pending_status) {
-               pr_err("Missing tfo->write_pending_status()\n");
-               return -EINVAL;
-       }
        if (!tfo->set_default_node_attributes) {
                pr_err("Missing tfo->set_default_node_attributes()\n");
                return -EINVAL;
index c2e1fc927fdff8610d831d0e128ceeaf2fad3162..9be1418e919f58db40a7de7eb251e7a98578c597 100644 (file)
@@ -442,11 +442,6 @@ static int xcopy_pt_write_pending(struct se_cmd *se_cmd)
        return 0;
 }
 
-static int xcopy_pt_write_pending_status(struct se_cmd *se_cmd)
-{
-       return 0;
-}
-
 static int xcopy_pt_queue_data_in(struct se_cmd *se_cmd)
 {
        return 0;
@@ -463,7 +458,6 @@ static const struct target_core_fabric_ops xcopy_pt_tfo = {
        .release_cmd            = xcopy_pt_release_cmd,
        .check_stop_free        = xcopy_pt_check_stop_free,
        .write_pending          = xcopy_pt_write_pending,
-       .write_pending_status   = xcopy_pt_write_pending_status,
        .queue_data_in          = xcopy_pt_queue_data_in,
        .queue_status           = xcopy_pt_queue_status,
 };
index 11d27b93b41392aee08a4034c1e828927521defc..b8ced44581181187f7bd6b6d8511bf452da6f5ee 100644 (file)
@@ -158,7 +158,6 @@ void ft_release_cmd(struct se_cmd *);
 int ft_queue_status(struct se_cmd *);
 int ft_queue_data_in(struct se_cmd *);
 int ft_write_pending(struct se_cmd *);
-int ft_write_pending_status(struct se_cmd *);
 int ft_get_cmd_state(struct se_cmd *);
 void ft_queue_tm_resp(struct se_cmd *);
 void ft_aborted_task(struct se_cmd *);
index a183d4da7db25d387ae2df08be18ebf35a5ab73a..f0529ba58f4ceaa889a40a94fc8fe6bb1aea1316 100644 (file)
@@ -184,13 +184,6 @@ int ft_queue_status(struct se_cmd *se_cmd)
        return 0;
 }
 
-int ft_write_pending_status(struct se_cmd *se_cmd)
-{
-       struct ft_cmd *cmd = container_of(se_cmd, struct ft_cmd, se_cmd);
-
-       return cmd->write_data_len != se_cmd->data_length;
-}
-
 /*
  * Send TX_RDY (transfer ready).
  */
index 1ce49518d44091a6775077861267f1b5f6e80d19..c873a052fcb0376bf69e27ecc275b68142d46e90 100644 (file)
@@ -437,7 +437,6 @@ static const struct target_core_fabric_ops ft_fabric_ops = {
        .sess_get_index =               ft_sess_get_index,
        .sess_get_initiator_sid =       NULL,
        .write_pending =                ft_write_pending,
-       .write_pending_status =         ft_write_pending_status,
        .set_default_node_attributes =  ft_set_default_node_attr,
        .get_cmd_state =                ft_get_cmd_state,
        .queue_data_in =                ft_queue_data_in,
index 34f5982cab784344d9382a36a5883c52a02d84c8..7f01f78b1d238a055639a56846d78b87d1b8b7d4 100644 (file)
@@ -1292,14 +1292,6 @@ static u32 usbg_sess_get_index(struct se_session *se_sess)
        return 0;
 }
 
-/*
- * XXX Error recovery: return != 0 if we expect writes. Dunno when that could be
- */
-static int usbg_write_pending_status(struct se_cmd *se_cmd)
-{
-       return 0;
-}
-
 static void usbg_set_default_node_attrs(struct se_node_acl *nacl)
 {
 }
@@ -1725,7 +1717,6 @@ static const struct target_core_fabric_ops usbg_ops = {
        .sess_get_index                 = usbg_sess_get_index,
        .sess_get_initiator_sid         = NULL,
        .write_pending                  = usbg_send_write_request,
-       .write_pending_status           = usbg_write_pending_status,
        .set_default_node_attributes    = usbg_set_default_node_attrs,
        .get_cmd_state                  = usbg_get_cmd_state,
        .queue_data_in                  = usbg_send_read_response,
index 8e10ab436d1f13bbf38c8f15dcfcb06c4fc3ab46..ad7899f99b97b36ed937664c3815a9d90e0cc2e4 100644 (file)
@@ -346,11 +346,6 @@ static int vhost_scsi_write_pending(struct se_cmd *se_cmd)
        return 0;
 }
 
-static int vhost_scsi_write_pending_status(struct se_cmd *se_cmd)
-{
-       return 0;
-}
-
 static void vhost_scsi_set_default_node_attrs(struct se_node_acl *nacl)
 {
        return;
@@ -2298,7 +2293,6 @@ static const struct target_core_fabric_ops vhost_scsi_ops = {
        .sess_get_index                 = vhost_scsi_sess_get_index,
        .sess_get_initiator_sid         = NULL,
        .write_pending                  = vhost_scsi_write_pending,
-       .write_pending_status           = vhost_scsi_write_pending_status,
        .set_default_node_attributes    = vhost_scsi_set_default_node_attrs,
        .get_cmd_state                  = vhost_scsi_get_cmd_state,
        .queue_data_in                  = vhost_scsi_queue_data_in,
index c9e23a12621868e14bba2e2984e62f809a26324c..e59937293a32683e15e546fdd787e9097666fb2a 100644 (file)
@@ -1404,11 +1404,6 @@ static int scsiback_write_pending(struct se_cmd *se_cmd)
        return 0;
 }
 
-static int scsiback_write_pending_status(struct se_cmd *se_cmd)
-{
-       return 0;
-}
-
 static void scsiback_set_default_node_attrs(struct se_node_acl *nacl)
 {
 }
@@ -1818,7 +1813,6 @@ static const struct target_core_fabric_ops scsiback_ops = {
        .sess_get_index                 = scsiback_sess_get_index,
        .sess_get_initiator_sid         = NULL,
        .write_pending                  = scsiback_write_pending,
-       .write_pending_status           = scsiback_write_pending_status,
        .set_default_node_attributes    = scsiback_set_default_node_attrs,
        .get_cmd_state                  = scsiback_get_cmd_state,
        .queue_data_in                  = scsiback_queue_data_in,
index ee5ddd81cd8d6c18e6993cde5bca990cdb7ebb46..691c6b5e6520295193aef262f64379c5bad25bcb 100644 (file)
@@ -74,7 +74,6 @@ struct target_core_fabric_ops {
        u32 (*sess_get_initiator_sid)(struct se_session *,
                                      unsigned char *, u32);
        int (*write_pending)(struct se_cmd *);
-       int (*write_pending_status)(struct se_cmd *);
        void (*set_default_node_attributes)(struct se_node_acl *);
        int (*get_cmd_state)(struct se_cmd *);
        int (*queue_data_in)(struct se_cmd *);