Commit 01466caf authored by Ben Walker's avatar Ben Walker Committed by Jim Harris
Browse files

thread: Allow NULL wait entry when getting a buffer



Do not require the entry when getting a buffer.

Change-Id: I879bdc171b0692aad24e9e15ab6aeb4afe41ba06
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16322


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent f1e8c9ce
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -432,9 +432,11 @@ spdk_iobuf_get(struct spdk_iobuf_channel *ch, uint64_t len,
		sz = spdk_ring_dequeue(pool->pool, (void **)bufs, spdk_min(IOBUF_BATCH_SIZE,
				       spdk_max(pool->cache_size, 1)));
		if (sz == 0) {
			if (entry) {
				STAILQ_INSERT_TAIL(pool->queue, entry, stailq);
				entry->module = ch->module;
				entry->cb_fn = cb_fn;
			}

			return NULL;
		}