aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2012-02-28 03:22:12 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2012-03-10 17:42:55 -0500
commitc7ec05c82bfd6acf1fd800d628591500805f3179 (patch)
treec64d5d330120d038f5ee9fe90b7a7eba0a0b3459
parent99367f01b8df2018ff3328ddf4111e701d34188d (diff)
target: Drop unused legacy target_core_fabric_ops API callers
This patch drops the following unused legacy API callers from target_core_fabric.h: *) TFO->fall_back_to_erl0() *) TFO->stop_session() *) TFO->sess_logged_in() *) TFO->is_state_remove() This patch also removes the stub usage in loopback, tcm_fc, iscsi_target, and ib_srpt fabric modules. Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r--drivers/infiniband/ulp/srpt/ib_srpt.c28
-rw-r--r--drivers/target/iscsi/iscsi_target_configfs.c43
-rw-r--r--drivers/target/loopback/tcm_loop.c33
-rw-r--r--drivers/target/target_core_configfs.c16
-rw-r--r--drivers/target/tcm_fc/tcm_fc.h4
-rw-r--r--drivers/target/tcm_fc/tfc_cmd.c5
-rw-r--r--drivers/target/tcm_fc/tfc_conf.c4
-rw-r--r--drivers/target/tcm_fc/tfc_sess.c19
-rw-r--r--include/target/target_core_fabric.h4
9 files changed, 0 insertions, 156 deletions
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 3290a57b248e..6735b63d96f0 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -3521,25 +3521,6 @@ static void srpt_close_session(struct se_session *se_sess)
3521} 3521}
3522 3522
3523/** 3523/**
3524 * To do: Find out whether stop_session() has a meaning for transports
3525 * other than iSCSI.
3526 */
3527static void srpt_stop_session(struct se_session *se_sess, int sess_sleep,
3528 int conn_sleep)
3529{
3530}
3531
3532static void srpt_reset_nexus(struct se_session *sess)
3533{
3534 printk(KERN_ERR "This is the SRP protocol, not iSCSI\n");
3535}
3536
3537static int srpt_sess_logged_in(struct se_session *se_sess)
3538{
3539 return true;
3540}
3541
3542/**
3543 * srpt_sess_get_index() - Return the value of scsiAttIntrPortIndex (SCSI-MIB). 3524 * srpt_sess_get_index() - Return the value of scsiAttIntrPortIndex (SCSI-MIB).
3544 * 3525 *
3545 * A quote from RFC 4455 (SCSI-MIB) about this MIB object: 3526 * A quote from RFC 4455 (SCSI-MIB) about this MIB object:
@@ -3583,11 +3564,6 @@ static u16 srpt_get_fabric_sense_len(void)
3583 return 0; 3564 return 0;
3584} 3565}
3585 3566
3586static int srpt_is_state_remove(struct se_cmd *se_cmd)
3587{
3588 return 0;
3589}
3590
3591/** 3567/**
3592 * srpt_parse_i_port_id() - Parse an initiator port ID. 3568 * srpt_parse_i_port_id() - Parse an initiator port ID.
3593 * @name: ASCII representation of a 128-bit initiator port ID. 3569 * @name: ASCII representation of a 128-bit initiator port ID.
@@ -3957,9 +3933,6 @@ static struct target_core_fabric_ops srpt_template = {
3957 .check_stop_free = srpt_check_stop_free, 3933 .check_stop_free = srpt_check_stop_free,
3958 .shutdown_session = srpt_shutdown_session, 3934 .shutdown_session = srpt_shutdown_session,
3959 .close_session = srpt_close_session, 3935 .close_session = srpt_close_session,
3960 .stop_session = srpt_stop_session,
3961 .fall_back_to_erl0 = srpt_reset_nexus,
3962 .sess_logged_in = srpt_sess_logged_in,
3963 .sess_get_index = srpt_sess_get_index, 3936 .sess_get_index = srpt_sess_get_index,
3964 .sess_get_initiator_sid = NULL, 3937 .sess_get_initiator_sid = NULL,
3965 .write_pending = srpt_write_pending, 3938 .write_pending = srpt_write_pending,
@@ -3972,7 +3945,6 @@ static struct target_core_fabric_ops srpt_template = {
3972 .queue_tm_rsp = srpt_queue_response, 3945 .queue_tm_rsp = srpt_queue_response,
3973 .get_fabric_sense_len = srpt_get_fabric_sense_len, 3946 .get_fabric_sense_len = srpt_get_fabric_sense_len,
3974 .set_fabric_sense_len = srpt_set_fabric_sense_len, 3947 .set_fabric_sense_len = srpt_set_fabric_sense_len,
3975 .is_state_remove = srpt_is_state_remove,
3976 /* 3948 /*
3977 * Setup function pointers for generic logic in 3949 * Setup function pointers for generic logic in
3978 * target_core_fabric_configfs.c 3950 * target_core_fabric_configfs.c
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c
index 1174f74f4fbc..00c58cc82c85 100644
--- a/drivers/target/iscsi/iscsi_target_configfs.c
+++ b/drivers/target/iscsi/iscsi_target_configfs.c
@@ -1503,28 +1503,6 @@ static int iscsi_get_cmd_state(struct se_cmd *se_cmd)
1503 return cmd->i_state; 1503 return cmd->i_state;
1504} 1504}
1505 1505
1506static int iscsi_is_state_remove(struct se_cmd *se_cmd)
1507{
1508 struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_cmd, se_cmd);
1509
1510 return (cmd->i_state == ISTATE_REMOVE);
1511}
1512
1513static int lio_sess_logged_in(struct se_session *se_sess)
1514{
1515 struct iscsi_session *sess = se_sess->fabric_sess_ptr;
1516 int ret;
1517 /*
1518 * Called with spin_lock_bh(&tpg_lock); and
1519 * spin_lock(&se_tpg->session_lock); held.
1520 */
1521 spin_lock(&sess->conn_lock);
1522 ret = (sess->session_state != TARG_SESS_STATE_LOGGED_IN);
1523 spin_unlock(&sess->conn_lock);
1524
1525 return ret;
1526}
1527
1528static u32 lio_sess_get_index(struct se_session *se_sess) 1506static u32 lio_sess_get_index(struct se_session *se_sess)
1529{ 1507{
1530 struct iscsi_session *sess = se_sess->fabric_sess_ptr; 1508 struct iscsi_session *sess = se_sess->fabric_sess_ptr;
@@ -1718,23 +1696,6 @@ static void lio_tpg_close_session(struct se_session *se_sess)
1718 iscsit_close_session(sess); 1696 iscsit_close_session(sess);
1719} 1697}
1720 1698
1721static void lio_tpg_stop_session(
1722 struct se_session *se_sess,
1723 int sess_sleep,
1724 int conn_sleep)
1725{
1726 struct iscsi_session *sess = se_sess->fabric_sess_ptr;
1727
1728 iscsit_stop_session(sess, sess_sleep, conn_sleep);
1729}
1730
1731static void lio_tpg_fall_back_to_erl0(struct se_session *se_sess)
1732{
1733 struct iscsi_session *sess = se_sess->fabric_sess_ptr;
1734
1735 iscsit_fall_back_to_erl0(sess);
1736}
1737
1738static u32 lio_tpg_get_inst_index(struct se_portal_group *se_tpg) 1699static u32 lio_tpg_get_inst_index(struct se_portal_group *se_tpg)
1739{ 1700{
1740 struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; 1701 struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
@@ -1798,9 +1759,6 @@ int iscsi_target_register_configfs(void)
1798 fabric->tf_ops.release_cmd = &lio_release_cmd; 1759 fabric->tf_ops.release_cmd = &lio_release_cmd;
1799 fabric->tf_ops.shutdown_session = &lio_tpg_shutdown_session; 1760 fabric->tf_ops.shutdown_session = &lio_tpg_shutdown_session;
1800 fabric->tf_ops.close_session = &lio_tpg_close_session; 1761 fabric->tf_ops.close_session = &lio_tpg_close_session;
1801 fabric->tf_ops.stop_session = &lio_tpg_stop_session;
1802 fabric->tf_ops.fall_back_to_erl0 = &lio_tpg_fall_back_to_erl0;
1803 fabric->tf_ops.sess_logged_in = &lio_sess_logged_in;
1804 fabric->tf_ops.sess_get_index = &lio_sess_get_index; 1762 fabric->tf_ops.sess_get_index = &lio_sess_get_index;
1805 fabric->tf_ops.sess_get_initiator_sid = &lio_sess_get_initiator_sid; 1763 fabric->tf_ops.sess_get_initiator_sid = &lio_sess_get_initiator_sid;
1806 fabric->tf_ops.write_pending = &lio_write_pending; 1764 fabric->tf_ops.write_pending = &lio_write_pending;
@@ -1814,7 +1772,6 @@ int iscsi_target_register_configfs(void)
1814 fabric->tf_ops.queue_tm_rsp = &lio_queue_tm_rsp; 1772 fabric->tf_ops.queue_tm_rsp = &lio_queue_tm_rsp;
1815 fabric->tf_ops.set_fabric_sense_len = &lio_set_fabric_sense_len; 1773 fabric->tf_ops.set_fabric_sense_len = &lio_set_fabric_sense_len;
1816 fabric->tf_ops.get_fabric_sense_len = &lio_get_fabric_sense_len; 1774 fabric->tf_ops.get_fabric_sense_len = &lio_get_fabric_sense_len;
1817 fabric->tf_ops.is_state_remove = &iscsi_is_state_remove;
1818 /* 1775 /*
1819 * Setup function pointers for generic logic in target_core_fabric_configfs.c 1776 * Setup function pointers for generic logic in target_core_fabric_configfs.c
1820 */ 1777 */
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index 041673e9d2db..026dffa0ed5a 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -736,22 +736,6 @@ static u32 tcm_loop_get_inst_index(struct se_portal_group *se_tpg)
736 return 1; 736 return 1;
737} 737}
738 738
739static int tcm_loop_is_state_remove(struct se_cmd *se_cmd)
740{
741 /*
742 * Assume struct scsi_cmnd is not in remove state..
743 */
744 return 0;
745}
746
747static int tcm_loop_sess_logged_in(struct se_session *se_sess)
748{
749 /*
750 * Assume that TL Nexus is always active
751 */
752 return 1;
753}
754
755static u32 tcm_loop_sess_get_index(struct se_session *se_sess) 739static u32 tcm_loop_sess_get_index(struct se_session *se_sess)
756{ 740{
757 return 1; 741 return 1;
@@ -785,19 +769,6 @@ static void tcm_loop_close_session(struct se_session *se_sess)
785 return; 769 return;
786}; 770};
787 771
788static void tcm_loop_stop_session(
789 struct se_session *se_sess,
790 int sess_sleep,
791 int conn_sleep)
792{
793 return;
794}
795
796static void tcm_loop_fall_back_to_erl0(struct se_session *se_sess)
797{
798 return;
799}
800
801static int tcm_loop_write_pending(struct se_cmd *se_cmd) 772static int tcm_loop_write_pending(struct se_cmd *se_cmd)
802{ 773{
803 /* 774 /*
@@ -1391,9 +1362,6 @@ static int tcm_loop_register_configfs(void)
1391 fabric->tf_ops.release_cmd = &tcm_loop_release_cmd; 1362 fabric->tf_ops.release_cmd = &tcm_loop_release_cmd;
1392 fabric->tf_ops.shutdown_session = &tcm_loop_shutdown_session; 1363 fabric->tf_ops.shutdown_session = &tcm_loop_shutdown_session;
1393 fabric->tf_ops.close_session = &tcm_loop_close_session; 1364 fabric->tf_ops.close_session = &tcm_loop_close_session;
1394 fabric->tf_ops.stop_session = &tcm_loop_stop_session;
1395 fabric->tf_ops.fall_back_to_erl0 = &tcm_loop_fall_back_to_erl0;
1396 fabric->tf_ops.sess_logged_in = &tcm_loop_sess_logged_in;
1397 fabric->tf_ops.sess_get_index = &tcm_loop_sess_get_index; 1365 fabric->tf_ops.sess_get_index = &tcm_loop_sess_get_index;
1398 fabric->tf_ops.sess_get_initiator_sid = NULL; 1366 fabric->tf_ops.sess_get_initiator_sid = NULL;
1399 fabric->tf_ops.write_pending = &tcm_loop_write_pending; 1367 fabric->tf_ops.write_pending = &tcm_loop_write_pending;
@@ -1410,7 +1378,6 @@ static int tcm_loop_register_configfs(void)
1410 fabric->tf_ops.queue_tm_rsp = &tcm_loop_queue_tm_rsp; 1378 fabric->tf_ops.queue_tm_rsp = &tcm_loop_queue_tm_rsp;
1411 fabric->tf_ops.set_fabric_sense_len = &tcm_loop_set_fabric_sense_len; 1379 fabric->tf_ops.set_fabric_sense_len = &tcm_loop_set_fabric_sense_len;
1412 fabric->tf_ops.get_fabric_sense_len = &tcm_loop_get_fabric_sense_len; 1380 fabric->tf_ops.get_fabric_sense_len = &tcm_loop_get_fabric_sense_len;
1413 fabric->tf_ops.is_state_remove = &tcm_loop_is_state_remove;
1414 1381
1415 tf_cg = &fabric->tf_group; 1382 tf_cg = &fabric->tf_group;
1416 /* 1383 /*
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index 2ecde0d4d4e5..72bd7f5d6795 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -421,18 +421,6 @@ static int target_fabric_tf_ops_check(
421 pr_err("Missing tfo->close_session()\n"); 421 pr_err("Missing tfo->close_session()\n");
422 return -EINVAL; 422 return -EINVAL;
423 } 423 }
424 if (!tfo->stop_session) {
425 pr_err("Missing tfo->stop_session()\n");
426 return -EINVAL;
427 }
428 if (!tfo->fall_back_to_erl0) {
429 pr_err("Missing tfo->fall_back_to_erl0()\n");
430 return -EINVAL;
431 }
432 if (!tfo->sess_logged_in) {
433 pr_err("Missing tfo->sess_logged_in()\n");
434 return -EINVAL;
435 }
436 if (!tfo->sess_get_index) { 424 if (!tfo->sess_get_index) {
437 pr_err("Missing tfo->sess_get_index()\n"); 425 pr_err("Missing tfo->sess_get_index()\n");
438 return -EINVAL; 426 return -EINVAL;
@@ -477,10 +465,6 @@ static int target_fabric_tf_ops_check(
477 pr_err("Missing tfo->get_fabric_sense_len()\n"); 465 pr_err("Missing tfo->get_fabric_sense_len()\n");
478 return -EINVAL; 466 return -EINVAL;
479 } 467 }
480 if (!tfo->is_state_remove) {
481 pr_err("Missing tfo->is_state_remove()\n");
482 return -EINVAL;
483 }
484 /* 468 /*
485 * We at least require tfo->fabric_make_wwn(), tfo->fabric_drop_wwn() 469 * We at least require tfo->fabric_make_wwn(), tfo->fabric_drop_wwn()
486 * tfo->fabric_make_tpg() and tfo->fabric_drop_tpg() in 470 * tfo->fabric_make_tpg() and tfo->fabric_drop_tpg() in
diff --git a/drivers/target/tcm_fc/tcm_fc.h b/drivers/target/tcm_fc/tcm_fc.h
index 7906b9f8eba7..524b97683983 100644
--- a/drivers/target/tcm_fc/tcm_fc.h
+++ b/drivers/target/tcm_fc/tcm_fc.h
@@ -141,11 +141,8 @@ extern struct target_fabric_configfs *ft_configfs;
141void ft_sess_put(struct ft_sess *); 141void ft_sess_put(struct ft_sess *);
142int ft_sess_shutdown(struct se_session *); 142int ft_sess_shutdown(struct se_session *);
143void ft_sess_close(struct se_session *); 143void ft_sess_close(struct se_session *);
144void ft_sess_stop(struct se_session *, int, int);
145int ft_sess_logged_in(struct se_session *);
146u32 ft_sess_get_index(struct se_session *); 144u32 ft_sess_get_index(struct se_session *);
147u32 ft_sess_get_port_name(struct se_session *, unsigned char *, u32); 145u32 ft_sess_get_port_name(struct se_session *, unsigned char *, u32);
148void ft_sess_set_erl0(struct se_session *);
149 146
150void ft_lport_add(struct fc_lport *, void *); 147void ft_lport_add(struct fc_lport *, void *);
151void ft_lport_del(struct fc_lport *, void *); 148void ft_lport_del(struct fc_lport *, void *);
@@ -163,7 +160,6 @@ int ft_write_pending_status(struct se_cmd *);
163u32 ft_get_task_tag(struct se_cmd *); 160u32 ft_get_task_tag(struct se_cmd *);
164int ft_get_cmd_state(struct se_cmd *); 161int ft_get_cmd_state(struct se_cmd *);
165int ft_queue_tm_resp(struct se_cmd *); 162int ft_queue_tm_resp(struct se_cmd *);
166int ft_is_state_remove(struct se_cmd *);
167 163
168/* 164/*
169 * other internal functions. 165 * other internal functions.
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index 17ffc82274a4..b831461156bf 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -244,11 +244,6 @@ int ft_get_cmd_state(struct se_cmd *se_cmd)
244 return 0; 244 return 0;
245} 245}
246 246
247int ft_is_state_remove(struct se_cmd *se_cmd)
248{
249 return 0; /* XXX TBD */
250}
251
252/* 247/*
253 * FC sequence response handler for follow-on sequences (data) and aborts. 248 * FC sequence response handler for follow-on sequences (data) and aborts.
254 */ 249 */
diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_conf.c
index 73852fbc857b..f357039349ba 100644
--- a/drivers/target/tcm_fc/tfc_conf.c
+++ b/drivers/target/tcm_fc/tfc_conf.c
@@ -529,9 +529,6 @@ static struct target_core_fabric_ops ft_fabric_ops = {
529 .release_cmd = ft_release_cmd, 529 .release_cmd = ft_release_cmd,
530 .shutdown_session = ft_sess_shutdown, 530 .shutdown_session = ft_sess_shutdown,
531 .close_session = ft_sess_close, 531 .close_session = ft_sess_close,
532 .stop_session = ft_sess_stop,
533 .fall_back_to_erl0 = ft_sess_set_erl0,
534 .sess_logged_in = ft_sess_logged_in,
535 .sess_get_index = ft_sess_get_index, 532 .sess_get_index = ft_sess_get_index,
536 .sess_get_initiator_sid = NULL, 533 .sess_get_initiator_sid = NULL,
537 .write_pending = ft_write_pending, 534 .write_pending = ft_write_pending,
@@ -544,7 +541,6 @@ static struct target_core_fabric_ops ft_fabric_ops = {
544 .queue_tm_rsp = ft_queue_tm_resp, 541 .queue_tm_rsp = ft_queue_tm_resp,
545 .get_fabric_sense_len = ft_get_fabric_sense_len, 542 .get_fabric_sense_len = ft_get_fabric_sense_len,
546 .set_fabric_sense_len = ft_set_fabric_sense_len, 543 .set_fabric_sense_len = ft_set_fabric_sense_len,
547 .is_state_remove = ft_is_state_remove,
548 /* 544 /*
549 * Setup function pointers for generic logic in 545 * Setup function pointers for generic logic in
550 * target_core_fabric_configfs.c 546 * target_core_fabric_configfs.c
diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c
index 4c0507cf808c..a1d1f3c86447 100644
--- a/drivers/target/tcm_fc/tfc_sess.c
+++ b/drivers/target/tcm_fc/tfc_sess.c
@@ -338,20 +338,6 @@ void ft_sess_close(struct se_session *se_sess)
338 synchronize_rcu(); /* let transport deregister happen */ 338 synchronize_rcu(); /* let transport deregister happen */
339} 339}
340 340
341void ft_sess_stop(struct se_session *se_sess, int sess_sleep, int conn_sleep)
342{
343 struct ft_sess *sess = se_sess->fabric_sess_ptr;
344
345 pr_debug("port_id %x\n", sess->port_id);
346}
347
348int ft_sess_logged_in(struct se_session *se_sess)
349{
350 struct ft_sess *sess = se_sess->fabric_sess_ptr;
351
352 return sess->port_id != -1;
353}
354
355u32 ft_sess_get_index(struct se_session *se_sess) 341u32 ft_sess_get_index(struct se_session *se_sess)
356{ 342{
357 struct ft_sess *sess = se_sess->fabric_sess_ptr; 343 struct ft_sess *sess = se_sess->fabric_sess_ptr;
@@ -367,11 +353,6 @@ u32 ft_sess_get_port_name(struct se_session *se_sess,
367 return ft_format_wwn(buf, len, sess->port_name); 353 return ft_format_wwn(buf, len, sess->port_name);
368} 354}
369 355
370void ft_sess_set_erl0(struct se_session *se_sess)
371{
372 /* XXX TBD called when out of memory */
373}
374
375/* 356/*
376 * libfc ops involving sessions. 357 * libfc ops involving sessions.
377 */ 358 */
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index 032c48753cfa..10c690809601 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -58,9 +58,6 @@ struct target_core_fabric_ops {
58 */ 58 */
59 int (*shutdown_session)(struct se_session *); 59 int (*shutdown_session)(struct se_session *);
60 void (*close_session)(struct se_session *); 60 void (*close_session)(struct se_session *);
61 void (*stop_session)(struct se_session *, int, int);
62 void (*fall_back_to_erl0)(struct se_session *);
63 int (*sess_logged_in)(struct se_session *);
64 u32 (*sess_get_index)(struct se_session *); 61 u32 (*sess_get_index)(struct se_session *);
65 /* 62 /*
66 * Used only for SCSI fabrics that contain multi-value TransportIDs 63 * Used only for SCSI fabrics that contain multi-value TransportIDs
@@ -78,7 +75,6 @@ struct target_core_fabric_ops {
78 int (*queue_tm_rsp)(struct se_cmd *); 75 int (*queue_tm_rsp)(struct se_cmd *);
79 u16 (*set_fabric_sense_len)(struct se_cmd *, u32); 76 u16 (*set_fabric_sense_len)(struct se_cmd *, u32);
80 u16 (*get_fabric_sense_len)(void); 77 u16 (*get_fabric_sense_len)(void);
81 int (*is_state_remove)(struct se_cmd *);
82 /* 78 /*
83 * fabric module calls for target_core_fabric_configfs.c 79 * fabric module calls for target_core_fabric_configfs.c
84 */ 80 */