Commit 8387e97f authored by Jacek Kalwas's avatar Jacek Kalwas Committed by Tomasz Zawadzki
Browse files

nvmf: simplify listen_associate interface



There is no need for this interface to be async.

Signed-off-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I1f21b53e90b7d165b6b5fb2e1226ce7591966b58
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4181


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent ae207216
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -242,17 +242,11 @@ struct spdk_nvmf_transport_ops {
	 * action here, as the enforcement of the association is done in the generic
	 * code.
	 *
	 * The association is not considered complete until cb_fn is called. New
	 * connections on the listener targeting this subsystem will be rejected
	 * until that time.
	 *
	 * Pass a negated errno code to `cb_fn` to block the association. 0 to allow.
	 * Returns a negated errno code to block the association. 0 to allow.
	 */
	void (*listen_associate)(struct spdk_nvmf_transport *transport,
	int (*listen_associate)(struct spdk_nvmf_transport *transport,
				const struct spdk_nvmf_subsystem *subsystem,
				 const struct spdk_nvme_transport_id *trid,
				 spdk_nvmf_tgt_subsystem_listen_done_fn cb_fn,
				 void *cb_arg);
				const struct spdk_nvme_transport_id *trid);

	/**
	 * Check for new connections on the transport.
+4 −5
Original line number Diff line number Diff line
@@ -831,6 +831,7 @@ spdk_nvmf_subsystem_add_listener(struct spdk_nvmf_subsystem *subsystem,
	struct spdk_nvmf_transport *transport;
	struct spdk_nvmf_subsystem_listener *listener;
	struct spdk_nvmf_listener *tr_listener;
	int rc = 0;

	assert(cb_fn != NULL);

@@ -874,12 +875,10 @@ spdk_nvmf_subsystem_add_listener(struct spdk_nvmf_subsystem *subsystem,
	listener->ana_state = SPDK_NVME_ANA_OPTIMIZED_STATE;

	if (transport->ops->listen_associate != NULL) {
		transport->ops->listen_associate(transport, subsystem, trid,
						 _nvmf_subsystem_add_listener_done,
						 listener);
	} else {
		_nvmf_subsystem_add_listener_done(listener, 0);
		rc = transport->ops->listen_associate(transport, subsystem, trid);
	}

	_nvmf_subsystem_add_listener_done(listener, rc);
}

int