Commit 4368937b authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Jim Harris
Browse files

bdev/part: remove thread safety from part_construct()



spdk_bdev_part_construct() must be now called on the
same thread that called spdk_bdev_part_base_construct().

This was always the case so far and I don't see any other
case where thread safety could be useful, so just remove
it. The doxygen doesn't say anything about it either.

Even in GPT case, we create a base directly as a part of
examine and then create part bdevs in the spdk_bdev_read()
completion callback, but that callback will be always
executed on the same thread which issued the read.

Change-Id: I752f2a7f08c9faf4231ed53a46b700b33fa13697
Signed-off-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466024


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBroadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 9b2b1640
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ spdk_bdev_part_free_cb(void *io_device)

	TAILQ_REMOVE(base->tailq, part, tailq);

	if (__sync_sub_and_fetch(&base->ref, 1) == 0) {
	if (--base->ref == 0) {
		spdk_bdev_module_release_bdev(base->bdev);
		spdk_bdev_part_base_free(base);
	}
@@ -457,7 +457,7 @@ spdk_bdev_part_construct(struct spdk_bdev_part *part, struct spdk_bdev_part_base
		return -1;
	}

	__sync_fetch_and_add(&base->ref, 1);
	base->ref++;
	part->internal.base = base;

	if (!base->claimed) {