Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7ec05c8 authored by Nicholas Bellinger's avatar Nicholas Bellinger
Browse files

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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 99367f01
Loading
Loading
Loading
Loading
+0 −28
Original line number Original line Diff line number Diff line
@@ -3520,25 +3520,6 @@ static void srpt_close_session(struct se_session *se_sess)
	WARN_ON(res <= 0);
	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).
 * 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;
	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.
 * srpt_parse_i_port_id() - Parse an initiator port ID.
 * @name: ASCII representation of a 128-bit 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,
	.check_stop_free		= srpt_check_stop_free,
	.shutdown_session		= srpt_shutdown_session,
	.shutdown_session		= srpt_shutdown_session,
	.close_session			= srpt_close_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_index			= srpt_sess_get_index,
	.sess_get_initiator_sid		= NULL,
	.sess_get_initiator_sid		= NULL,
	.write_pending			= srpt_write_pending,
	.write_pending			= srpt_write_pending,
@@ -3972,7 +3945,6 @@ static struct target_core_fabric_ops srpt_template = {
	.queue_tm_rsp			= srpt_queue_response,
	.queue_tm_rsp			= srpt_queue_response,
	.get_fabric_sense_len		= srpt_get_fabric_sense_len,
	.get_fabric_sense_len		= srpt_get_fabric_sense_len,
	.set_fabric_sense_len		= srpt_set_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
	 * Setup function pointers for generic logic in
	 * target_core_fabric_configfs.c
	 * target_core_fabric_configfs.c
+0 −43
Original line number Original line Diff line number Diff line
@@ -1503,28 +1503,6 @@ static int iscsi_get_cmd_state(struct se_cmd *se_cmd)
	return cmd->i_state;
	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)
static u32 lio_sess_get_index(struct se_session *se_sess)
{
{
	struct iscsi_session *sess = se_sess->fabric_sess_ptr;
	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);
	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)
static u32 lio_tpg_get_inst_index(struct se_portal_group *se_tpg)
{
{
	struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
	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.release_cmd = &lio_release_cmd;
	fabric->tf_ops.shutdown_session = &lio_tpg_shutdown_session;
	fabric->tf_ops.shutdown_session = &lio_tpg_shutdown_session;
	fabric->tf_ops.close_session = &lio_tpg_close_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_index = &lio_sess_get_index;
	fabric->tf_ops.sess_get_initiator_sid = &lio_sess_get_initiator_sid;
	fabric->tf_ops.sess_get_initiator_sid = &lio_sess_get_initiator_sid;
	fabric->tf_ops.write_pending = &lio_write_pending;
	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.queue_tm_rsp = &lio_queue_tm_rsp;
	fabric->tf_ops.set_fabric_sense_len = &lio_set_fabric_sense_len;
	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.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
	 * Setup function pointers for generic logic in target_core_fabric_configfs.c
	 */
	 */
+0 −33
Original line number Original line Diff line number Diff line
@@ -736,22 +736,6 @@ static u32 tcm_loop_get_inst_index(struct se_portal_group *se_tpg)
	return 1;
	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)
static u32 tcm_loop_sess_get_index(struct se_session *se_sess)
{
{
	return 1;
	return 1;
@@ -785,19 +769,6 @@ static void tcm_loop_close_session(struct se_session *se_sess)
	return;
	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)
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.release_cmd = &tcm_loop_release_cmd;
	fabric->tf_ops.shutdown_session = &tcm_loop_shutdown_session;
	fabric->tf_ops.shutdown_session = &tcm_loop_shutdown_session;
	fabric->tf_ops.close_session = &tcm_loop_close_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_index = &tcm_loop_sess_get_index;
	fabric->tf_ops.sess_get_initiator_sid = NULL;
	fabric->tf_ops.sess_get_initiator_sid = NULL;
	fabric->tf_ops.write_pending = &tcm_loop_write_pending;
	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.queue_tm_rsp = &tcm_loop_queue_tm_rsp;
	fabric->tf_ops.set_fabric_sense_len = &tcm_loop_set_fabric_sense_len;
	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.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;
	tf_cg = &fabric->tf_group;
	/*
	/*
+0 −16
Original line number Original line Diff line number Diff line
@@ -421,18 +421,6 @@ static int target_fabric_tf_ops_check(
		pr_err("Missing tfo->close_session()\n");
		pr_err("Missing tfo->close_session()\n");
		return -EINVAL;
		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) {
	if (!tfo->sess_get_index) {
		pr_err("Missing tfo->sess_get_index()\n");
		pr_err("Missing tfo->sess_get_index()\n");
		return -EINVAL;
		return -EINVAL;
@@ -477,10 +465,6 @@ static int target_fabric_tf_ops_check(
		pr_err("Missing tfo->get_fabric_sense_len()\n");
		pr_err("Missing tfo->get_fabric_sense_len()\n");
		return -EINVAL;
		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()
	 * We at least require tfo->fabric_make_wwn(), tfo->fabric_drop_wwn()
	 * tfo->fabric_make_tpg() and tfo->fabric_drop_tpg() in
	 * tfo->fabric_make_tpg() and tfo->fabric_drop_tpg() in
+0 −4
Original line number Original line Diff line number Diff line
@@ -141,11 +141,8 @@ extern struct target_fabric_configfs *ft_configfs;
void ft_sess_put(struct ft_sess *);
void ft_sess_put(struct ft_sess *);
int ft_sess_shutdown(struct se_session *);
int ft_sess_shutdown(struct se_session *);
void ft_sess_close(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_index(struct se_session *);
u32 ft_sess_get_port_name(struct se_session *, unsigned char *, u32);
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_add(struct fc_lport *, void *);
void ft_lport_del(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 *);
u32 ft_get_task_tag(struct se_cmd *);
int ft_get_cmd_state(struct se_cmd *);
int ft_get_cmd_state(struct se_cmd *);
int ft_queue_tm_resp(struct se_cmd *);
int ft_queue_tm_resp(struct se_cmd *);
int ft_is_state_remove(struct se_cmd *);


/*
/*
 * other internal functions.
 * other internal functions.
Loading