Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

target: make close_session optional

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

authored by

Christoph Hellwig and committed by
Nicholas Bellinger
36ec2ddc 22d11759

+2 -41
-8
Documentation/target/tcm_mod_builder.py
··· 294 294 buf += " .tpg_check_prod_mode_write_protect = " + fabric_mod_name + "_check_false,\n" 295 295 buf += " .tpg_get_inst_index = " + fabric_mod_name + "_tpg_get_inst_index,\n" 296 296 buf += " .release_cmd = " + fabric_mod_name + "_release_cmd,\n" 297 - buf += " .close_session = " + fabric_mod_name + "_close_session,\n" 298 297 buf += " .sess_get_index = " + fabric_mod_name + "_sess_get_index,\n" 299 298 buf += " .sess_get_initiator_sid = NULL,\n" 300 299 buf += " .write_pending = " + fabric_mod_name + "_write_pending,\n" ··· 464 465 buf += " return;\n" 465 466 buf += "}\n\n" 466 467 bufi += "void " + fabric_mod_name + "_release_cmd(struct se_cmd *);\n" 467 - 468 - if re.search('close_session\)\(', fo): 469 - buf += "void " + fabric_mod_name + "_close_session(struct se_session *se_sess)\n" 470 - buf += "{\n" 471 - buf += " return;\n" 472 - buf += "}\n\n" 473 - bufi += "void " + fabric_mod_name + "_close_session(struct se_session *);\n" 474 468 475 469 if re.search('sess_get_index\)\(', fo): 476 470 buf += "u32 " + fabric_mod_name + "_sess_get_index(struct se_session *se_sess)\n"
-6
drivers/target/loopback/tcm_loop.c
··· 601 601 return tl_cmd->sc_cmd_state; 602 602 } 603 603 604 - static void tcm_loop_close_session(struct se_session *se_sess) 605 - { 606 - return; 607 - }; 608 - 609 604 static int tcm_loop_write_pending(struct se_cmd *se_cmd) 610 605 { 611 606 /* ··· 1233 1238 .tpg_get_inst_index = tcm_loop_get_inst_index, 1234 1239 .check_stop_free = tcm_loop_check_stop_free, 1235 1240 .release_cmd = tcm_loop_release_cmd, 1236 - .close_session = tcm_loop_close_session, 1237 1241 .sess_get_index = tcm_loop_sess_get_index, 1238 1242 .write_pending = tcm_loop_write_pending, 1239 1243 .write_pending_status = tcm_loop_write_pending_status,
-6
drivers/target/sbp/sbp_target.c
··· 1726 1726 sbp_free_request(req); 1727 1727 } 1728 1728 1729 - static void sbp_close_session(struct se_session *se_sess) 1730 - { 1731 - return; 1732 - } 1733 - 1734 1729 static u32 sbp_sess_get_index(struct se_session *se_sess) 1735 1730 { 1736 1731 return 0; ··· 2339 2344 .tpg_check_prod_mode_write_protect = sbp_check_false, 2340 2345 .tpg_get_inst_index = sbp_tpg_get_inst_index, 2341 2346 .release_cmd = sbp_release_cmd, 2342 - .close_session = sbp_close_session, 2343 2347 .sess_get_index = sbp_sess_get_index, 2344 2348 .write_pending = sbp_write_pending, 2345 2349 .write_pending_status = sbp_write_pending_status,
-4
drivers/target/target_core_configfs.c
··· 385 385 pr_err("Missing tfo->release_cmd()\n"); 386 386 return -EINVAL; 387 387 } 388 - if (!tfo->close_session) { 389 - pr_err("Missing tfo->close_session()\n"); 390 - return -EINVAL; 391 - } 392 388 if (!tfo->sess_get_index) { 393 389 pr_err("Missing tfo->sess_get_index()\n"); 394 390 return -EINVAL;
+2 -1
drivers/target/target_core_transport.c
··· 436 436 struct se_session, sess_kref); 437 437 struct se_portal_group *se_tpg = se_sess->se_tpg; 438 438 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); 440 441 } 441 442 442 443 int target_get_session(struct se_session *se_sess)
-5
drivers/usb/gadget/function/f_tcm.c
··· 1290 1290 percpu_ida_free(&se_sess->sess_tag_pool, se_cmd->map_tag); 1291 1291 } 1292 1292 1293 - static void usbg_close_session(struct se_session *se_sess) 1294 - { 1295 - } 1296 - 1297 1293 static u32 usbg_sess_get_index(struct se_session *se_sess) 1298 1294 { 1299 1295 return 0; ··· 1726 1730 .tpg_check_prod_mode_write_protect = usbg_check_false, 1727 1731 .tpg_get_inst_index = usbg_tpg_get_inst_index, 1728 1732 .release_cmd = usbg_release_cmd, 1729 - .close_session = usbg_close_session, 1730 1733 .sess_get_index = usbg_sess_get_index, 1731 1734 .sess_get_initiator_sid = NULL, 1732 1735 .write_pending = usbg_send_write_request,
-6
drivers/vhost/scsi.c
··· 333 333 percpu_ida_free(&se_sess->sess_tag_pool, se_cmd->map_tag); 334 334 } 335 335 336 - static void vhost_scsi_close_session(struct se_session *se_sess) 337 - { 338 - return; 339 - } 340 - 341 336 static u32 vhost_scsi_sess_get_index(struct se_session *se_sess) 342 337 { 343 338 return 0; ··· 2104 2109 .tpg_get_inst_index = vhost_scsi_tpg_get_inst_index, 2105 2110 .release_cmd = vhost_scsi_release_cmd, 2106 2111 .check_stop_free = vhost_scsi_check_stop_free, 2107 - .close_session = vhost_scsi_close_session, 2108 2112 .sess_get_index = vhost_scsi_sess_get_index, 2109 2113 .sess_get_initiator_sid = NULL, 2110 2114 .write_pending = vhost_scsi_write_pending,
-5
drivers/xen/xen-scsiback.c
··· 1399 1399 percpu_ida_free(&se_sess->sess_tag_pool, se_cmd->map_tag); 1400 1400 } 1401 1401 1402 - static void scsiback_close_session(struct se_session *se_sess) 1403 - { 1404 - } 1405 - 1406 1402 static u32 scsiback_sess_get_index(struct se_session *se_sess) 1407 1403 { 1408 1404 return 0; ··· 1832 1836 .tpg_get_inst_index = scsiback_tpg_get_inst_index, 1833 1837 .check_stop_free = scsiback_check_stop_free, 1834 1838 .release_cmd = scsiback_release_cmd, 1835 - .close_session = scsiback_close_session, 1836 1839 .sess_get_index = scsiback_sess_get_index, 1837 1840 .sess_get_initiator_sid = NULL, 1838 1841 .write_pending = scsiback_write_pending,