target: make ->shutdown_session optional
Turns out the template and thus many drivers got the return value wrong: 0 means the fabrics driver needs to put a session reference, which no driver except for the iSCSI target drivers did. Fortunately none of these drivers supports explicit Node ACLs, so the bug was harmless. Even without that only qla2xxx and iscsi every did real work in shutdown_session, so get rid of the boilerplate code in all other drivers. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
This commit is contained in:

committato da
Nicholas Bellinger

parent
fba81f8831
commit
22d11759a4
@@ -139,7 +139,6 @@ extern unsigned int ft_debug_logging;
|
||||
* Session ops.
|
||||
*/
|
||||
void ft_sess_put(struct ft_sess *);
|
||||
int ft_sess_shutdown(struct se_session *);
|
||||
void ft_sess_close(struct se_session *);
|
||||
u32 ft_sess_get_index(struct se_session *);
|
||||
u32 ft_sess_get_port_name(struct se_session *, unsigned char *, u32);
|
||||
|
@@ -442,7 +442,6 @@ static const struct target_core_fabric_ops ft_fabric_ops = {
|
||||
.tpg_get_inst_index = ft_tpg_get_inst_index,
|
||||
.check_stop_free = ft_check_stop_free,
|
||||
.release_cmd = ft_release_cmd,
|
||||
.shutdown_session = ft_sess_shutdown,
|
||||
.close_session = ft_sess_close,
|
||||
.sess_get_index = ft_sess_get_index,
|
||||
.sess_get_initiator_sid = NULL,
|
||||
|
@@ -302,18 +302,6 @@ static void ft_sess_delete_all(struct ft_tport *tport)
|
||||
* TCM ops for sessions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Determine whether session is allowed to be shutdown in the current context.
|
||||
* Returns non-zero if the session should be shutdown.
|
||||
*/
|
||||
int ft_sess_shutdown(struct se_session *se_sess)
|
||||
{
|
||||
struct ft_sess *sess = se_sess->fabric_sess_ptr;
|
||||
|
||||
pr_debug("port_id %x\n", sess->port_id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove session and send PRLO.
|
||||
* This is called when the ACL is being deleted or queue depth is changing.
|
||||
|
Fai riferimento in un nuovo problema
Block a user