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: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466024 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
9b2b1640b3
commit
4368937b4e
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user