diff mbox

[RFC,21/34] iscsi-target: release transport driver resources

Message ID 26d1bde8e55db6d2f77a354b379bec78bb7b7322.1455467089.git.varun@chelsio.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Varun Prakash Feb. 14, 2016, 5:42 p.m. UTC
transport driver may allocate resources for an
iSCSI cmd, to free that resources iscsi target
must call release function registered by transport
driver.

ISCSI_TCP_CXGB4 frees DDP resource associated
with a WRITE cmd in the callback function.

Signed-off-by: Varun Prakash <varun@chelsio.com>
---
 drivers/target/iscsi/iscsi_target_util.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Christoph Hellwig March 1, 2016, 2:59 p.m. UTC | #1
On Sun, Feb 14, 2016 at 11:12:15PM +0530, Varun Prakash wrote:
> transport driver may allocate resources for an
> iSCSI cmd, to free that resources iscsi target
> must call release function registered by transport
> driver.
> 
> ISCSI_TCP_CXGB4 frees DDP resource associated
> with a WRITE cmd in the callback function.

This should go with the patch introducing the method.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Varun Prakash March 2, 2016, 12:15 p.m. UTC | #2
On Tue, Mar 01, 2016 at 08:29:53PM +0530, Christoph Hellwig wrote:
> On Sun, Feb 14, 2016 at 11:12:15PM +0530, Varun Prakash wrote:
> > transport driver may allocate resources for an
> > iSCSI cmd, to free that resources iscsi target
> > must call release function registered by transport
> > driver.
> > 
> > ISCSI_TCP_CXGB4 frees DDP resource associated
> > with a WRITE cmd in the callback function.
> 
> This should go with the patch introducing the method.

Ok, I will update it in v2 series.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c
index 5cab517..71240e4 100644
--- a/drivers/target/iscsi/iscsi_target_util.c
+++ b/drivers/target/iscsi/iscsi_target_util.c
@@ -727,6 +727,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)