Skip to content

Commit fb7c70f

Browse files
Mike Christiemartinkpetersen
authored andcommitted
scsi: target: add session removal function
This adds a function to remove a session which should be used by drivers that use target_setup_session. The next patches will convert the target drivers to use this new function. Signed-off-by: Mike Christie <mchristi@redhat.com> Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: Chris Boot <bootc@bootc.net> Cc: Bryant G. Ly <bryantly@linux.vnet.ibm.com> Cc: Michael Cyr <mikecyr@linux.vnet.ibm.com> Cc: <qla2xxx-upstream@qlogic.com> Cc: Johannes Thumshirn <jth@kernel.org> Cc: Felipe Balbi <balbi@kernel.org> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Juergen Gross <jgross@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent fa83428 commit fb7c70f

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎drivers/target/target_core_transport.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,13 @@ void transport_deregister_session(struct se_session *se_sess)
616616
}
617617
EXPORT_SYMBOL(transport_deregister_session);
618618

619+
void target_remove_session(struct se_session *se_sess)
620+
{
621+
transport_deregister_session_configfs(se_sess);
622+
transport_deregister_session(se_sess);
623+
}
624+
EXPORT_SYMBOL(target_remove_session);
625+
619626
static void target_remove_from_state_list(struct se_cmd *cmd)
620627
{
621628
struct se_device *dev = cmd->se_dev;

‎include/target/target_core_fabric.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ struct se_session *target_setup_session(struct se_portal_group *,
114114
const char *, void *,
115115
int (*callback)(struct se_portal_group *,
116116
struct se_session *, void *));
117+
void target_remove_session(struct se_session *);
117118

118119
void transport_init_session(struct se_session *);
119120
struct se_session *transport_alloc_session(enum target_prot_op);

0 commit comments

Comments
 (0)