Re: [Devel] [PATCH VZ9 2/3] block/blk-cbt: allow multiple cbts in a single queue

2025-01-23 Thread Pavel Tikhomirov
On 1/23/25 17:14, Andrey Zhadchenko wrote: On 1/23/25 09:05, Pavel Tikhomirov wrote: General comment: Do we need a restriction on maximum amount of cbts? E.g. in next patch we allow to read cbts list from userspace, if we have to many cbts it can be not so trivial to allocate proper buffe

Re: [Devel] [PATCH VZ9 2/3] block/blk-cbt: allow multiple cbts in a single queue

2025-01-23 Thread Pavel Tikhomirov
On 1/22/25 19:29, Andrey Zhadchenko wrote: On 1/22/25 12:14, Pavel Tikhomirov wrote: On 1/22/25 19:05, Andrey Zhadchenko wrote: On 1/22/25 11:51, Pavel Tikhomirov wrote: +static struct cbt_info *blk_cbt_find(struct request_queue *q, __u8 *name) +{ +    struct cbt_info *cbt; + +    lis

Re: [Devel] [PATCH VZ9 2/3] block/blk-cbt: allow multiple cbts in a single queue

2025-01-23 Thread Pavel Tikhomirov
+static int cbt_ioc_stop(struct block_device *bdev, struct blk_user_cbt_info __user *ucbt_ioc) +{ + struct blk_user_cbt_info ci; struct request_queue *q; + struct cbt_info *cbt; + + if (copy_from_user(&ci, ucbt_ioc, sizeof(ci))) + return -EFAULT; m

Re: [Devel] [PATCH VZ9 2/3] block/blk-cbt: allow multiple cbts in a single queue

2025-01-23 Thread Andrey Zhadchenko
On 1/23/25 09:05, Pavel Tikhomirov wrote: General comment: Do we need a restriction on maximum amount of cbts? E.g. in next patch we allow to read cbts list from userspace, if we have to many cbts it can be not so trivial to allocate proper buffer to get them all at once. Currently userspa

Re: [Devel] [PATCH VZ9 2/3] block/blk-cbt: allow multiple cbts in a single queue

2025-01-23 Thread Pavel Tikhomirov
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) { -

Re: [Devel] [PATCH VZ9 2/3] block/blk-cbt: allow multiple cbts in a single queue

2025-01-23 Thread Pavel Tikhomirov
General comment: Do we need a restriction on maximum amount of cbts? E.g. in next patch we allow to read cbts list from userspace, if we have to many cbts it can be not so trivial to allocate proper buffer to get them all at once. On 1/20/25 16:34, Andrey Zhadchenko wrote: Store cbts in a li

Re: [Devel] [PATCH VZ9 2/3] block/blk-cbt: allow multiple cbts in a single queue

2025-01-22 Thread Andrey Zhadchenko
On 1/22/25 12:14, Pavel Tikhomirov wrote: On 1/22/25 19:05, Andrey Zhadchenko wrote: On 1/22/25 11:51, Pavel Tikhomirov wrote: +static struct cbt_info *blk_cbt_find(struct request_queue *q, __u8 *name) +{ +    struct cbt_info *cbt; + +    list_for_each_entry(cbt, &q->cbt_list, list) +   

Re: [Devel] [PATCH VZ9 2/3] block/blk-cbt: allow multiple cbts in a single queue

2025-01-22 Thread Pavel Tikhomirov
On 1/22/25 19:05, Andrey Zhadchenko wrote: On 1/22/25 11:51, Pavel Tikhomirov wrote: +static struct cbt_info *blk_cbt_find(struct request_queue *q, __u8 *name) +{ +    struct cbt_info *cbt; + +    list_for_each_entry(cbt, &q->cbt_list, list) +    if (!memcmp(name, cbt->name, CBT_NAME_LE

Re: [Devel] [PATCH VZ9 2/3] block/blk-cbt: allow multiple cbts in a single queue

2025-01-22 Thread Andrey Zhadchenko
On 1/22/25 11:51, Pavel Tikhomirov wrote: +static struct cbt_info *blk_cbt_find(struct request_queue *q, __u8 *name) +{ +    struct cbt_info *cbt; + +    list_for_each_entry(cbt, &q->cbt_list, list) +    if (!memcmp(name, cbt->name, CBT_NAME_LENGTH)) +    return cbt; + +    return

Re: [Devel] [PATCH VZ9 2/3] block/blk-cbt: allow multiple cbts in a single queue

2025-01-22 Thread Pavel Tikhomirov
+static struct cbt_info *blk_cbt_find(struct request_queue *q, __u8 *name) +{ + struct cbt_info *cbt; + + list_for_each_entry(cbt, &q->cbt_list, list) + if (!memcmp(name, cbt->name, CBT_NAME_LENGTH)) + return cbt; + + return NULL; +} + static

Re: [Devel] [PATCH VZ9 2/3] block/blk-cbt: allow multiple cbts in a single queue

2025-01-22 Thread Pavel Tikhomirov
@@ -272,6 +275,7 @@ static struct cbt_info *do_cbt_alloc(struct request_queue *q, __u8 *name, if (!cbt) return ERR_PTR(-ENOMEM); + INIT_LIST_HEAD(&cbt->list); This initialization is excess, it is only required for a list_head we add TO, the added list_head can be

[Devel] [PATCH VZ9 2/3] block/blk-cbt: allow multiple cbts in a single queue

2025-01-20 Thread Andrey Zhadchenko
Store cbts in a list instead of a single pointer. Update all APIs to work with user-specified bitmap. https://virtuozzo.atlassian.net/browse/VSTOR-96269 Signed-off-by: Andrey Zhadchenko --- block/blk-cbt.c | 174 +--- block/blk-core.c| 2 + i