Skip to content

Commit 36ec2dd

Browse files
Christoph HellwigNicholas Bellinger
authored andcommitted
target: make close_session optional
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
1 parent 22d1175 commit 36ec2dd

8 files changed

Lines changed: 2 additions & 41 deletions

File tree

‎Documentation/target/tcm_mod_builder.py‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
294294
buf += " .tpg_check_prod_mode_write_protect = " + fabric_mod_name + "_check_false,\n"
295295
buf += " .tpg_get_inst_index = " + fabric_mod_name + "_tpg_get_inst_index,\n"
296296
buf += " .release_cmd = " + fabric_mod_name + "_release_cmd,\n"
297-
buf += " .close_session = " + fabric_mod_name + "_close_session,\n"
298297
buf += " .sess_get_index = " + fabric_mod_name + "_sess_get_index,\n"
299298
buf += " .sess_get_initiator_sid = NULL,\n"
300299
buf += " .write_pending = " + fabric_mod_name + "_write_pending,\n"
@@ -466,13 +465,6 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
466465
buf += "}\n\n"
467466
bufi += "void " + fabric_mod_name + "_release_cmd(struct se_cmd *);\n"
468467

469-
if re.search('close_session\)\(', fo):
470-
buf += "void " + fabric_mod_name + "_close_session(struct se_session *se_sess)\n"
471-
buf += "{\n"
472-
buf += " return;\n"
473-
buf += "}\n\n"
474-
bufi += "void " + fabric_mod_name + "_close_session(struct se_session *);\n"
475-
476468
if re.search('sess_get_index\)\(', fo):
477469
buf += "u32 " + fabric_mod_name + "_sess_get_index(struct se_session *se_sess)\n"
478470
buf += "{\n"

‎drivers/target/loopback/tcm_loop.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -601,11 +601,6 @@ static int tcm_loop_get_cmd_state(struct se_cmd *se_cmd)
601601
return tl_cmd->sc_cmd_state;
602602
}
603603

604-
static void tcm_loop_close_session(struct se_session *se_sess)
605-
{
606-
return;
607-
};
608-
609604
static int tcm_loop_write_pending(struct se_cmd *se_cmd)
610605
{
611606
/*
@@ -1238,7 +1233,6 @@ static const struct target_core_fabric_ops loop_ops = {
12381233
.tpg_get_inst_index = tcm_loop_get_inst_index,
12391234
.check_stop_free = tcm_loop_check_stop_free,
12401235
.release_cmd = tcm_loop_release_cmd,
1241-
.close_session = tcm_loop_close_session,
12421236
.sess_get_index = tcm_loop_sess_get_index,
12431237
.write_pending = tcm_loop_write_pending,
12441238
.write_pending_status = tcm_loop_write_pending_status,

‎drivers/target/sbp/sbp_target.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,11 +1726,6 @@ static void sbp_release_cmd(struct se_cmd *se_cmd)
17261726
sbp_free_request(req);
17271727
}
17281728

1729-
static void sbp_close_session(struct se_session *se_sess)
1730-
{
1731-
return;
1732-
}
1733-
17341729
static u32 sbp_sess_get_index(struct se_session *se_sess)
17351730
{
17361731
return 0;
@@ -2344,7 +2339,6 @@ static const struct target_core_fabric_ops sbp_ops = {
23442339
.tpg_check_prod_mode_write_protect = sbp_check_false,
23452340
.tpg_get_inst_index = sbp_tpg_get_inst_index,
23462341
.release_cmd = sbp_release_cmd,
2347-
.close_session = sbp_close_session,
23482342
.sess_get_index = sbp_sess_get_index,
23492343
.write_pending = sbp_write_pending,
23502344
.write_pending_status = sbp_write_pending_status,

‎drivers/target/target_core_configfs.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,6 @@ static int target_fabric_tf_ops_check(const struct target_core_fabric_ops *tfo)
385385
pr_err("Missing tfo->release_cmd()\n");
386386
return -EINVAL;
387387
}
388-
if (!tfo->close_session) {
389-
pr_err("Missing tfo->close_session()\n");
390-
return -EINVAL;
391-
}
392388
if (!tfo->sess_get_index) {
393389
pr_err("Missing tfo->sess_get_index()\n");
394390
return -EINVAL;

‎drivers/target/target_core_transport.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,8 @@ static void target_release_session(struct kref *kref)
436436
struct se_session, sess_kref);
437437
struct se_portal_group *se_tpg = se_sess->se_tpg;
438438

439-
se_tpg->se_tpg_tfo->close_session(se_sess);
439+
if (se_tpg->se_tpg_tfo->close_session)
440+
se_tpg->se_tpg_tfo->close_session(se_sess);
440441
}
441442

442443
int target_get_session(struct se_session *se_sess)

‎drivers/usb/gadget/function/f_tcm.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,10 +1290,6 @@ static void usbg_release_cmd(struct se_cmd *se_cmd)
12901290
percpu_ida_free(&se_sess->sess_tag_pool, se_cmd->map_tag);
12911291
}
12921292

1293-
static void usbg_close_session(struct se_session *se_sess)
1294-
{
1295-
}
1296-
12971293
static u32 usbg_sess_get_index(struct se_session *se_sess)
12981294
{
12991295
return 0;
@@ -1730,7 +1726,6 @@ static const struct target_core_fabric_ops usbg_ops = {
17301726
.tpg_check_prod_mode_write_protect = usbg_check_false,
17311727
.tpg_get_inst_index = usbg_tpg_get_inst_index,
17321728
.release_cmd = usbg_release_cmd,
1733-
.close_session = usbg_close_session,
17341729
.sess_get_index = usbg_sess_get_index,
17351730
.sess_get_initiator_sid = NULL,
17361731
.write_pending = usbg_send_write_request,

‎drivers/vhost/scsi.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,6 @@ static void vhost_scsi_release_cmd(struct se_cmd *se_cmd)
333333
percpu_ida_free(&se_sess->sess_tag_pool, se_cmd->map_tag);
334334
}
335335

336-
static void vhost_scsi_close_session(struct se_session *se_sess)
337-
{
338-
return;
339-
}
340-
341336
static u32 vhost_scsi_sess_get_index(struct se_session *se_sess)
342337
{
343338
return 0;
@@ -2109,7 +2104,6 @@ static struct target_core_fabric_ops vhost_scsi_ops = {
21092104
.tpg_get_inst_index = vhost_scsi_tpg_get_inst_index,
21102105
.release_cmd = vhost_scsi_release_cmd,
21112106
.check_stop_free = vhost_scsi_check_stop_free,
2112-
.close_session = vhost_scsi_close_session,
21132107
.sess_get_index = vhost_scsi_sess_get_index,
21142108
.sess_get_initiator_sid = NULL,
21152109
.write_pending = vhost_scsi_write_pending,

‎drivers/xen/xen-scsiback.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,10 +1399,6 @@ static void scsiback_release_cmd(struct se_cmd *se_cmd)
13991399
percpu_ida_free(&se_sess->sess_tag_pool, se_cmd->map_tag);
14001400
}
14011401

1402-
static void scsiback_close_session(struct se_session *se_sess)
1403-
{
1404-
}
1405-
14061402
static u32 scsiback_sess_get_index(struct se_session *se_sess)
14071403
{
14081404
return 0;
@@ -1836,7 +1832,6 @@ static const struct target_core_fabric_ops scsiback_ops = {
18361832
.tpg_get_inst_index = scsiback_tpg_get_inst_index,
18371833
.check_stop_free = scsiback_check_stop_free,
18381834
.release_cmd = scsiback_release_cmd,
1839-
.close_session = scsiback_close_session,
18401835
.sess_get_index = scsiback_sess_get_index,
18411836
.sess_get_initiator_sid = NULL,
18421837
.write_pending = scsiback_write_pending,

0 commit comments

Comments
 (0)