nvmf: Move detection of 0 connections on a session to session layer
This logically belongs inside the session handling code, not in the transport-specific layer. Change-Id: I93b2271f38dbfc742162c98c40acb153c7e9022a Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
3e1a251ed7
commit
3a4c101b2d
@ -668,9 +668,6 @@ spdk_nvmf_handle_disconnect(spdk_event_t event)
|
||||
struct spdk_nvmf_conn *conn = spdk_event_get_arg2(event);
|
||||
|
||||
nvmf_disconnect(session, conn);
|
||||
if (session && session->num_connections == 0) {
|
||||
spdk_nvmf_session_destruct(session);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -168,7 +168,7 @@ spdk_nvmf_session_destruct(struct nvmf_session *session)
|
||||
struct spdk_nvmf_conn *conn = TAILQ_FIRST(&session->connections);
|
||||
|
||||
TAILQ_REMOVE(&session->connections, conn, link);
|
||||
nvmf_disconnect(conn->sess, conn);
|
||||
session->num_connections--;
|
||||
conn->transport->conn_fini(conn);
|
||||
}
|
||||
|
||||
@ -313,6 +313,11 @@ nvmf_disconnect(struct nvmf_session *session,
|
||||
{
|
||||
session->num_connections--;
|
||||
TAILQ_REMOVE(&session->connections, conn, link);
|
||||
conn->transport->conn_fini(conn);
|
||||
|
||||
if (session->num_connections == 0) {
|
||||
spdk_nvmf_session_destruct(session);
|
||||
}
|
||||
}
|
||||
|
||||
static uint64_t
|
||||
|
Loading…
Reference in New Issue
Block a user