iscsi-target: add void (*iscsit_release_cmd)()
authorVarun Prakash <varun@chelsio.com>
Tue, 19 Apr 2016 18:30:09 +0000 (00:00 +0530)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 10 May 2016 06:12:06 +0000 (23:12 -0700)
Add void (*iscsit_release_cmd)() to
struct iscsit_transport, iscsi-target
uses this callback to release transport
driver resources associated with an iSCSI cmd.

cxgbit.ko needs this callback to release DDP
resource and sg page in case of
PASSTHROUGH_SG_TO_MEM_NOALLOC.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target_util.c
include/target/iscsi/iscsi_transport.h

index 428b0d9e3dbab246e579a027344dbc60f6a64098..a5330171ebe59a570168d0d5b1dd3b0ca2953344 100644 (file)
@@ -725,6 +725,9 @@ void __iscsit_free_cmd(struct iscsi_cmd *cmd, bool scsi_cmd,
                iscsit_remove_cmd_from_immediate_queue(cmd, conn);
                iscsit_remove_cmd_from_response_queue(cmd, conn);
        }
+
+       if (conn && conn->conn_transport->iscsit_release_cmd)
+               conn->conn_transport->iscsit_release_cmd(conn, cmd);
 }
 
 void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown)
index 24b613a09aee336a8e67ca3f0d1a1a7740c463ba..3b0053efdfba6c2933ce579e9dd77ba8b307d8d0 100644 (file)
@@ -24,6 +24,7 @@ struct iscsit_transport {
        void (*iscsit_aborted_task)(struct iscsi_conn *, struct iscsi_cmd *);
        int (*iscsit_xmit_pdu)(struct iscsi_conn *, struct iscsi_cmd *,
                               struct iscsi_datain_req *, const void *, u32);
+       void (*iscsit_release_cmd)(struct iscsi_conn *, struct iscsi_cmd *);
        enum target_prot_op (*iscsit_get_sup_prot_ops)(struct iscsi_conn *);
 };