[Devel] [PATCH VZ9 2/3] block/blk-cbt: allow multiple cbts in a single queue
Pavel Tikhomirov
ptikhomirov at virtuozzo.com
Thu Jan 23 12:12:25 MSK 2025
> static int cbt_ioc_init(struct block_device *bdev, struct blk_user_cbt_info __user *ucbt_ioc)
> @@ -632,16 +633,13 @@ static int cbt_ioc_init(struct block_device *bdev, struct blk_user_cbt_info __us
>
> q = bdev_get_queue(bdev);
> mutex_lock(&cbt_mutex);
> - if (q->cbt) {
> - ret = -EBUSY;
> - goto err_mtx;
> - }
> +
> cbt = do_cbt_alloc(q, ci.ci_name, i_size_read(bdev->bd_inode), ci.ci_blksize);
> if (IS_ERR(cbt))
> ret = PTR_ERR(cbt);
> else
> - rcu_assign_pointer(q->cbt, cbt);
> -err_mtx:
> + list_add_tail_rcu(&q->cbt_list, &cbt->list);
should we check for cbt name collision?
> +
> mutex_unlock(&cbt_mutex);
> return ret;
> }
More information about the Devel
mailing list