Skip to content

Commit a6de50e

Browse files
author
Alexander Indenbaum
committed
bdev_rbd: use context_wq for read-only RBD image opens
Signed-off-by: Alexander Indenbaum <aindenba@redhat.com>
1 parent 4eb3246 commit a6de50e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

module/bdev/rbd/bdev_rbd.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -509,14 +509,14 @@ bdev_rbd_init_context(void *arg)
509509
}
510510

511511
assert(io_ctx != NULL);
512+
/* Find reactor thread, create SpdkContextWQ if available, then open with context_wq (NULL uses default AsioContextWQ) */
513+
struct spdk_thread *reactor_thread = bdev_rbd_find_reactor_thread();
514+
rbd->spdk_context_wq = bdev_rbd_spdk_context_wq_create_from_ioctx(
515+
*io_ctx, reactor_thread);
512516
if (rbd->rbd_read_only) {
513517
SPDK_DEBUGLOG(bdev_rbd, "Will open RBD image %s/%s as read-only\n", rbd->pool_name, rbd->rbd_name);
514-
rc = rbd_open_read_only(*io_ctx, rbd->rbd_name, &rbd->image, NULL);
518+
rc = rbd_open_read_only_with_context_wq(*io_ctx, rbd->rbd_name, &rbd->image, NULL, rbd->spdk_context_wq);
515519
} else {
516-
/* Find reactor thread, create SpdkContextWQ if available, then open with context_wq (NULL uses default AsioContextWQ) */
517-
struct spdk_thread *reactor_thread = bdev_rbd_find_reactor_thread();
518-
rbd->spdk_context_wq = bdev_rbd_spdk_context_wq_create_from_ioctx(
519-
*io_ctx, reactor_thread);
520520
rc = rbd_open_with_context_wq(*io_ctx, rbd->rbd_name, &rbd->image, NULL, rbd->spdk_context_wq);
521521
}
522522
if (rc < 0) {

0 commit comments

Comments
 (0)