提交 c7ec05c8 编写于 作者: N Nicholas Bellinger

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: NNicholas Bellinger <nab@linux-iscsi.org>
上级 99367f01
......@@ -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
......
......@@ -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
*/
......
......@@ -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;
/*
......
......@@ -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
......
......@@ -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.
......
......@@ -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.
*/
......
......@@ -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
......
......@@ -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.
*/
......
......@@ -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
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册