bdev: move queue initialization up in bdev_register
The initialization has no side effects, so it can be done earlier, which allows for using functions that operate on these queues. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: I36830d815b7b43687f369dba2a0999a6dcca5a14 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11394 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
76add75f1b
commit
36e9dc6f16
@ -5745,6 +5745,11 @@ bdev_register(struct spdk_bdev *bdev)
|
||||
bdev->internal.qd_poller = NULL;
|
||||
bdev->internal.qos = NULL;
|
||||
|
||||
TAILQ_INIT(&bdev->internal.open_descs);
|
||||
TAILQ_INIT(&bdev->internal.locked_ranges);
|
||||
TAILQ_INIT(&bdev->internal.pending_locked_ranges);
|
||||
TAILQ_INIT(&bdev->aliases);
|
||||
|
||||
ret = bdev_name_add(&bdev->internal.bdev_name, bdev, bdev->name);
|
||||
if (ret != 0) {
|
||||
free(bdev_name);
|
||||
@ -5780,12 +5785,6 @@ bdev_register(struct spdk_bdev *bdev)
|
||||
bdev->phys_blocklen = spdk_bdev_get_data_block_size(bdev);
|
||||
}
|
||||
|
||||
TAILQ_INIT(&bdev->internal.open_descs);
|
||||
TAILQ_INIT(&bdev->internal.locked_ranges);
|
||||
TAILQ_INIT(&bdev->internal.pending_locked_ranges);
|
||||
|
||||
TAILQ_INIT(&bdev->aliases);
|
||||
|
||||
bdev->internal.reset_in_progress = NULL;
|
||||
|
||||
spdk_io_device_register(__bdev_to_io_dev(bdev),
|
||||
|
Loading…
Reference in New Issue
Block a user