target: Drop unused legacy target_core_fabric_ops API callers
authorNicholas Bellinger <nab@linux-iscsi.org>
Tue, 28 Feb 2012 08:22:12 +0000 (00:22 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sat, 10 Mar 2012 22:42:55 +0000 (14:42 -0800)
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>
drivers/infiniband/ulp/srpt/ib_srpt.c
drivers/target/iscsi/iscsi_target_configfs.c
drivers/target/loopback/tcm_loop.c
drivers/target/target_core_configfs.c
drivers/target/tcm_fc/tcm_fc.h
drivers/target/tcm_fc/tfc_cmd.c
drivers/target/tcm_fc/tfc_conf.c
drivers/target/tcm_fc/tfc_sess.c
include/target/target_core_fabric.h

index 3290a57b248ec92d39f749c2ac1e07a785e81b5b..6735b63d96f0fce09e89ca158b0b70ed1403a8ca 100644 (file)
@@ -3520,25 +3520,6 @@ static void srpt_close_session(struct se_session *se_sess)
        WARN_ON(res <= 0);
 }
 
-/**
- * To do: Find out whether stop_session() has a meaning for transports
- * other than iSCSI.
- */
-static void srpt_stop_session(struct se_session *se_sess, int sess_sleep,
-                             int conn_sleep)
-{
-}
-
-static void srpt_reset_nexus(struct se_session *sess)
-{
-       printk(KERN_ERR "This is the SRP protocol, not iSCSI\n");
-}
-
-static int srpt_sess_logged_in(struct se_session *se_sess)
-{
-       return true;
-}
-
 /**
  * srpt_sess_get_index() - Return the value of scsiAttIntrPortIndex (SCSI-MIB).
  *
@@ -3583,11 +3564,6 @@ static u16 srpt_get_fabric_sense_len(void)
        return 0;
 }
 
-static int srpt_is_state_remove(struct se_cmd *se_cmd)
-{
-       return 0;
-}
-
 /**
  * srpt_parse_i_port_id() - Parse an initiator port ID.
  * @name: ASCII representation of a 128-bit initiator port ID.
@@ -3957,9 +3933,6 @@ static struct target_core_fabric_ops srpt_template = {
        .check_stop_free                = srpt_check_stop_free,
        .shutdown_session               = srpt_shutdown_session,
        .close_session                  = srpt_close_session,
-       .stop_session                   = srpt_stop_session,
-       .fall_back_to_erl0              = srpt_reset_nexus,
-       .sess_logged_in                 = srpt_sess_logged_in,
        .sess_get_index                 = srpt_sess_get_index,
        .sess_get_initiator_sid         = NULL,
        .write_pending                  = srpt_write_pending,
@@ -3972,7 +3945,6 @@ static struct target_core_fabric_ops srpt_template = {
        .queue_tm_rsp                   = srpt_queue_response,
        .get_fabric_sense_len           = srpt_get_fabric_sense_len,
        .set_fabric_sense_len           = srpt_set_fabric_sense_len,
-       .is_state_remove                = srpt_is_state_remove,
        /*
         * Setup function pointers for generic logic in
         * target_core_fabric_configfs.c
index 1174f74f4fbcf51dd6d73001aaf3351784518062..00c58cc82c8595a91890558d5e56e30ccdae8495 100644 (file)
@@ -1503,28 +1503,6 @@ static int iscsi_get_cmd_state(struct se_cmd *se_cmd)
        return cmd->i_state;
 }
 
-static int iscsi_is_state_remove(struct se_cmd *se_cmd)
-{
-       struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_cmd, se_cmd);
-
-       return (cmd->i_state == ISTATE_REMOVE);
-}
-
-static int lio_sess_logged_in(struct se_session *se_sess)
-{
-       struct iscsi_session *sess = se_sess->fabric_sess_ptr;
-       int ret;
-       /*
-        * Called with spin_lock_bh(&tpg_lock); and
-        * spin_lock(&se_tpg->session_lock); held.
-        */
-       spin_lock(&sess->conn_lock);
-       ret = (sess->session_state != TARG_SESS_STATE_LOGGED_IN);
-       spin_unlock(&sess->conn_lock);
-
-       return ret;
-}
-
 static u32 lio_sess_get_index(struct se_session *se_sess)
 {
        struct iscsi_session *sess = se_sess->fabric_sess_ptr;
@@ -1718,23 +1696,6 @@ static void lio_tpg_close_session(struct se_session *se_sess)
        iscsit_close_session(sess);
 }
 
-static void lio_tpg_stop_session(
-       struct se_session *se_sess,
-       int sess_sleep,
-       int conn_sleep)
-{
-       struct iscsi_session *sess = se_sess->fabric_sess_ptr;
-
-       iscsit_stop_session(sess, sess_sleep, conn_sleep);
-}
-
-static void lio_tpg_fall_back_to_erl0(struct se_session *se_sess)
-{
-       struct iscsi_session *sess = se_sess->fabric_sess_ptr;
-
-       iscsit_fall_back_to_erl0(sess);
-}
-
 static u32 lio_tpg_get_inst_index(struct se_portal_group *se_tpg)
 {
        struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
@@ -1798,9 +1759,6 @@ int iscsi_target_register_configfs(void)
        fabric->tf_ops.release_cmd = &lio_release_cmd;
        fabric->tf_ops.shutdown_session = &lio_tpg_shutdown_session;
        fabric->tf_ops.close_session = &lio_tpg_close_session;
-       fabric->tf_ops.stop_session = &lio_tpg_stop_session;
-       fabric->tf_ops.fall_back_to_erl0 = &lio_tpg_fall_back_to_erl0;
-       fabric->tf_ops.sess_logged_in = &lio_sess_logged_in;
        fabric->tf_ops.sess_get_index = &lio_sess_get_index;
        fabric->tf_ops.sess_get_initiator_sid = &lio_sess_get_initiator_sid;
        fabric->tf_ops.write_pending = &lio_write_pending;
@@ -1814,7 +1772,6 @@ int iscsi_target_register_configfs(void)
        fabric->tf_ops.queue_tm_rsp = &lio_queue_tm_rsp;
        fabric->tf_ops.set_fabric_sense_len = &lio_set_fabric_sense_len;
        fabric->tf_ops.get_fabric_sense_len = &lio_get_fabric_sense_len;
-       fabric->tf_ops.is_state_remove = &iscsi_is_state_remove;
        /*
         * Setup function pointers for generic logic in target_core_fabric_configfs.c
         */
index 041673e9d2dbbae80e8b23ff6c522d97baf364f0..026dffa0ed5aa6a9698cc40c6ead4882f76179a5 100644 (file)
@@ -736,22 +736,6 @@ static u32 tcm_loop_get_inst_index(struct se_portal_group *se_tpg)
        return 1;
 }
 
-static int tcm_loop_is_state_remove(struct se_cmd *se_cmd)
-{
-       /*
-        * Assume struct scsi_cmnd is not in remove state..
-        */
-       return 0;
-}
-
-static int tcm_loop_sess_logged_in(struct se_session *se_sess)
-{
-       /*
-        * Assume that TL Nexus is always active
-        */
-       return 1;
-}
-
 static u32 tcm_loop_sess_get_index(struct se_session *se_sess)
 {
        return 1;
@@ -785,19 +769,6 @@ static void tcm_loop_close_session(struct se_session *se_sess)
        return;
 };
 
-static void tcm_loop_stop_session(
-       struct se_session *se_sess,
-       int sess_sleep,
-       int conn_sleep)
-{
-       return;
-}
-
-static void tcm_loop_fall_back_to_erl0(struct se_session *se_sess)
-{
-       return;
-}
-
 static int tcm_loop_write_pending(struct se_cmd *se_cmd)
 {
        /*
@@ -1391,9 +1362,6 @@ static int tcm_loop_register_configfs(void)
        fabric->tf_ops.release_cmd = &tcm_loop_release_cmd;
        fabric->tf_ops.shutdown_session = &tcm_loop_shutdown_session;
        fabric->tf_ops.close_session = &tcm_loop_close_session;
-       fabric->tf_ops.stop_session = &tcm_loop_stop_session;
-       fabric->tf_ops.fall_back_to_erl0 = &tcm_loop_fall_back_to_erl0;
-       fabric->tf_ops.sess_logged_in = &tcm_loop_sess_logged_in;
        fabric->tf_ops.sess_get_index = &tcm_loop_sess_get_index;
        fabric->tf_ops.sess_get_initiator_sid = NULL;
        fabric->tf_ops.write_pending = &tcm_loop_write_pending;
@@ -1410,7 +1378,6 @@ static int tcm_loop_register_configfs(void)
        fabric->tf_ops.queue_tm_rsp = &tcm_loop_queue_tm_rsp;
        fabric->tf_ops.set_fabric_sense_len = &tcm_loop_set_fabric_sense_len;
        fabric->tf_ops.get_fabric_sense_len = &tcm_loop_get_fabric_sense_len;
-       fabric->tf_ops.is_state_remove = &tcm_loop_is_state_remove;
 
        tf_cg = &fabric->tf_group;
        /*
index 2ecde0d4d4e52a52d2d0619ea8c2b7ed6514f7f5..72bd7f5d6795e38caadc1bfc02b2d79d9cd0caca 100644 (file)
@@ -421,18 +421,6 @@ static int target_fabric_tf_ops_check(
                pr_err("Missing tfo->close_session()\n");
                return -EINVAL;
        }
-       if (!tfo->stop_session) {
-               pr_err("Missing tfo->stop_session()\n");
-               return -EINVAL;
-       }
-       if (!tfo->fall_back_to_erl0) {
-               pr_err("Missing tfo->fall_back_to_erl0()\n");
-               return -EINVAL;
-       }
-       if (!tfo->sess_logged_in) {
-               pr_err("Missing tfo->sess_logged_in()\n");
-               return -EINVAL;
-       }
        if (!tfo->sess_get_index) {
                pr_err("Missing tfo->sess_get_index()\n");
                return -EINVAL;
@@ -477,10 +465,6 @@ static int target_fabric_tf_ops_check(
                pr_err("Missing tfo->get_fabric_sense_len()\n");
                return -EINVAL;
        }
-       if (!tfo->is_state_remove) {
-               pr_err("Missing tfo->is_state_remove()\n");
-               return -EINVAL;
-       }
        /*
         * We at least require tfo->fabric_make_wwn(), tfo->fabric_drop_wwn()
         * tfo->fabric_make_tpg() and tfo->fabric_drop_tpg() in
index 7906b9f8eba708e66272d7efeda35e60375730fd..524b9768398362064e596fd4677173b4326b1967 100644 (file)
@@ -141,11 +141,8 @@ extern struct target_fabric_configfs *ft_configfs;
 void ft_sess_put(struct ft_sess *);
 int ft_sess_shutdown(struct se_session *);
 void ft_sess_close(struct se_session *);
-void ft_sess_stop(struct se_session *, int, int);
-int ft_sess_logged_in(struct se_session *);
 u32 ft_sess_get_index(struct se_session *);
 u32 ft_sess_get_port_name(struct se_session *, unsigned char *, u32);
-void ft_sess_set_erl0(struct se_session *);
 
 void ft_lport_add(struct fc_lport *, void *);
 void ft_lport_del(struct fc_lport *, void *);
@@ -163,7 +160,6 @@ int ft_write_pending_status(struct se_cmd *);
 u32 ft_get_task_tag(struct se_cmd *);
 int ft_get_cmd_state(struct se_cmd *);
 int ft_queue_tm_resp(struct se_cmd *);
-int ft_is_state_remove(struct se_cmd *);
 
 /*
  * other internal functions.
index 17ffc82274a4387d9049e9f7131fc70153df0772..b831461156bf08ad093cee8928bf78c3d08e9684 100644 (file)
@@ -244,11 +244,6 @@ int ft_get_cmd_state(struct se_cmd *se_cmd)
        return 0;
 }
 
-int ft_is_state_remove(struct se_cmd *se_cmd)
-{
-       return 0;       /* XXX TBD */
-}
-
 /*
  * FC sequence response handler for follow-on sequences (data) and aborts.
  */
index 73852fbc857b4b5aee0622ee7b55fb5c0880291b..f357039349ba56b2b9ee2ed3b0b154bc7bd96fa9 100644 (file)
@@ -529,9 +529,6 @@ static struct target_core_fabric_ops ft_fabric_ops = {
        .release_cmd =                  ft_release_cmd,
        .shutdown_session =             ft_sess_shutdown,
        .close_session =                ft_sess_close,
-       .stop_session =                 ft_sess_stop,
-       .fall_back_to_erl0 =            ft_sess_set_erl0,
-       .sess_logged_in =               ft_sess_logged_in,
        .sess_get_index =               ft_sess_get_index,
        .sess_get_initiator_sid =       NULL,
        .write_pending =                ft_write_pending,
@@ -544,7 +541,6 @@ static struct target_core_fabric_ops ft_fabric_ops = {
        .queue_tm_rsp =                 ft_queue_tm_resp,
        .get_fabric_sense_len =         ft_get_fabric_sense_len,
        .set_fabric_sense_len =         ft_set_fabric_sense_len,
-       .is_state_remove =              ft_is_state_remove,
        /*
         * Setup function pointers for generic logic in
         * target_core_fabric_configfs.c
index 4c0507cf808c08662609765b41488a35c461add7..a1d1f3c864478045a6794ef42e7143ae37f802b9 100644 (file)
@@ -338,20 +338,6 @@ void ft_sess_close(struct se_session *se_sess)
        synchronize_rcu();              /* let transport deregister happen */
 }
 
-void ft_sess_stop(struct se_session *se_sess, int sess_sleep, int conn_sleep)
-{
-       struct ft_sess *sess = se_sess->fabric_sess_ptr;
-
-       pr_debug("port_id %x\n", sess->port_id);
-}
-
-int ft_sess_logged_in(struct se_session *se_sess)
-{
-       struct ft_sess *sess = se_sess->fabric_sess_ptr;
-
-       return sess->port_id != -1;
-}
-
 u32 ft_sess_get_index(struct se_session *se_sess)
 {
        struct ft_sess *sess = se_sess->fabric_sess_ptr;
@@ -367,11 +353,6 @@ u32 ft_sess_get_port_name(struct se_session *se_sess,
        return ft_format_wwn(buf, len, sess->port_name);
 }
 
-void ft_sess_set_erl0(struct se_session *se_sess)
-{
-       /* XXX TBD called when out of memory */
-}
-
 /*
  * libfc ops involving sessions.
  */
index 032c48753cfa8e6afaee7a146be1d96f60cc8c6e..10c6908096011fdc2c73628d707bed69b561afde 100644 (file)
@@ -58,9 +58,6 @@ struct target_core_fabric_ops {
         */
        int (*shutdown_session)(struct se_session *);
        void (*close_session)(struct se_session *);
-       void (*stop_session)(struct se_session *, int, int);
-       void (*fall_back_to_erl0)(struct se_session *);
-       int (*sess_logged_in)(struct se_session *);
        u32 (*sess_get_index)(struct se_session *);
        /*
         * Used only for SCSI fabrics that contain multi-value TransportIDs
@@ -78,7 +75,6 @@ struct target_core_fabric_ops {
        int (*queue_tm_rsp)(struct se_cmd *);
        u16 (*set_fabric_sense_len)(struct se_cmd *, u32);
        u16 (*get_fabric_sense_len)(void);
-       int (*is_state_remove)(struct se_cmd *);
        /*
         * fabric module calls for target_core_fabric_configfs.c
         */