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

Commit 36ec2ddc authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Nicholas Bellinger
Browse files

target: make close_session optional

parent 22d11759
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -294,7 +294,6 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name):
	buf += "	.tpg_check_prod_mode_write_protect = " + fabric_mod_name + "_check_false,\n"
	buf += "	.tpg_get_inst_index		= " + fabric_mod_name + "_tpg_get_inst_index,\n"
	buf += "	.release_cmd			= " + fabric_mod_name + "_release_cmd,\n"
	buf += "	.close_session			= " + fabric_mod_name + "_close_session,\n"
	buf += "	.sess_get_index			= " + fabric_mod_name + "_sess_get_index,\n"
	buf += "	.sess_get_initiator_sid		= NULL,\n"
	buf += "	.write_pending			= " + fabric_mod_name + "_write_pending,\n"
@@ -466,13 +465,6 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name):
			buf += "}\n\n"
			bufi += "void " + fabric_mod_name + "_release_cmd(struct se_cmd *);\n"

		if re.search('close_session\)\(', fo):
			buf += "void " + fabric_mod_name + "_close_session(struct se_session *se_sess)\n"
			buf += "{\n"
			buf += "	return;\n"
			buf += "}\n\n"
			bufi += "void " + fabric_mod_name + "_close_session(struct se_session *);\n"

		if re.search('sess_get_index\)\(', fo):
			buf += "u32 " + fabric_mod_name + "_sess_get_index(struct se_session *se_sess)\n"
			buf += "{\n"
+0 −6
Original line number Diff line number Diff line
@@ -601,11 +601,6 @@ static int tcm_loop_get_cmd_state(struct se_cmd *se_cmd)
	return tl_cmd->sc_cmd_state;
}

static void tcm_loop_close_session(struct se_session *se_sess)
{
	return;
};

static int tcm_loop_write_pending(struct se_cmd *se_cmd)
{
	/*
@@ -1238,7 +1233,6 @@ static const struct target_core_fabric_ops loop_ops = {
	.tpg_get_inst_index		= tcm_loop_get_inst_index,
	.check_stop_free		= tcm_loop_check_stop_free,
	.release_cmd			= tcm_loop_release_cmd,
	.close_session			= tcm_loop_close_session,
	.sess_get_index			= tcm_loop_sess_get_index,
	.write_pending			= tcm_loop_write_pending,
	.write_pending_status		= tcm_loop_write_pending_status,
+0 −6
Original line number Diff line number Diff line
@@ -1726,11 +1726,6 @@ static void sbp_release_cmd(struct se_cmd *se_cmd)
	sbp_free_request(req);
}

static void sbp_close_session(struct se_session *se_sess)
{
	return;
}

static u32 sbp_sess_get_index(struct se_session *se_sess)
{
	return 0;
@@ -2344,7 +2339,6 @@ static const struct target_core_fabric_ops sbp_ops = {
	.tpg_check_prod_mode_write_protect = sbp_check_false,
	.tpg_get_inst_index		= sbp_tpg_get_inst_index,
	.release_cmd			= sbp_release_cmd,
	.close_session			= sbp_close_session,
	.sess_get_index			= sbp_sess_get_index,
	.write_pending			= sbp_write_pending,
	.write_pending_status		= sbp_write_pending_status,
+0 −4
Original line number Diff line number Diff line
@@ -385,10 +385,6 @@ static int target_fabric_tf_ops_check(const struct target_core_fabric_ops *tfo)
		pr_err("Missing tfo->release_cmd()\n");
		return -EINVAL;
	}
	if (!tfo->close_session) {
		pr_err("Missing tfo->close_session()\n");
		return -EINVAL;
	}
	if (!tfo->sess_get_index) {
		pr_err("Missing tfo->sess_get_index()\n");
		return -EINVAL;
+2 −1
Original line number Diff line number Diff line
@@ -436,6 +436,7 @@ static void target_release_session(struct kref *kref)
			struct se_session, sess_kref);
	struct se_portal_group *se_tpg = se_sess->se_tpg;

	if (se_tpg->se_tpg_tfo->close_session)
		se_tpg->se_tpg_tfo->close_session(se_sess);
}

Loading