[Devel] [PATCH 3/4] blk-cbt: Don't open-code is_power_of_2 function

2023-01-27 Thread Nikolay Borisov
Signed-off-by: Nikolay Borisov --- block/blk-cbt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blk-cbt.c b/block/blk-cbt.c index 269709c7589b..68c7f71ec3a0 100644 --- a/block/blk-cbt.c +++ b/block/blk-cbt.c @@ -17,6 +17,7 @@ #include #include #include +#inclu

[Devel] [PATCH 1/4] blk-cbt: Remove needless zeroing

2023-01-27 Thread Nikolay Borisov
The per-cpu allocator guarantees the returned memory is going to be zeroed out so it's redundant to do our own zeroing when initialising cbt. Simply remove this code. Signed-off-by: Nikolay Borisov --- block/blk-cbt.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git

[Devel] [PATCH 4/4] blk-cbt: Don't open-code DIV_ROUND_UP macro

2023-01-27 Thread Nikolay Borisov
Using the macro makes the code more explicit and somewhat easier to comprehend. Signed-off-by: Nikolay Borisov --- block/blk-cbt.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/block/blk-cbt.c b/block/blk-cbt.c index 68c7f71ec3a0..967533a2a7a3 100644 --- a/block

[Devel] [PATCH 2/4] blk-cbt: Factor out common capability check

2023-01-27 Thread Nikolay Borisov
Instead of duplicating CAP_SYS_ADMIN check for every block-cbt ioctl apart from BLKCBTGET simply factor out the check in the beginning of blk_cbt_ioctl. Signed-off-by: Nikolay Borisov --- block/blk-cbt.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/block

Re: [Devel] [PATCH 1/4] blk-cbt: Remove needless zeroing

2023-01-27 Thread Konstantin Khorenko
Sasha, please review the patchset. -- Best regards, Konstantin Khorenko, Virtuozzo Linux Kernel Team On 27.01.2023 12:34, Nikolay Borisov wrote: The per-cpu allocator guarantees the returned memory is going to be zeroed out so it's redundant to do our own zeroing when initialising cbt. Simply

Re: [Devel] [PATCH 1/4] blk-cbt: Remove needless zeroing

2023-01-27 Thread Alexander Atanasov
On 27.01.23 13:34, Nikolay Borisov wrote: The per-cpu allocator guarantees the returned memory is going to be zeroed out so it's redundant to do our own zeroing when initialising cbt. Simply remove this code. Signed-off-by: Nikolay Borisov --- block/blk-cbt.c | 11 +-- 1 file changed

Re: [Devel] [PATCH 2/4] blk-cbt: Factor out common capability check

2023-01-27 Thread Alexander Atanasov
Hi, On 27.01.23 13:34, Nikolay Borisov wrote: Instead of duplicating CAP_SYS_ADMIN check for every block-cbt ioctl apart from BLKCBTGET simply factor out the check in the beginning of blk_cbt_ioctl. Signed-off-by: Nikolay Borisov --- block/blk-cbt.c | 17 +++-- 1 file changed, 3

Re: [Devel] [PATCH 3/4] blk-cbt: Don't open-code is_power_of_2 function

2023-01-27 Thread Alexander Atanasov
On 27.01.23 13:34, Nikolay Borisov wrote: Signed-off-by: Nikolay Borisov --- block/blk-cbt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blk-cbt.c b/block/blk-cbt.c index 269709c7589b..68c7f71ec3a0 100644 --- a/block/blk-cbt.c +++ b/block/blk-cbt.c @@ -17,6 +17

Re: [Devel] [PATCH 4/4] blk-cbt: Don't open-code DIV_ROUND_UP macro

2023-01-27 Thread Alexander Atanasov
On 27.01.23 13:34, Nikolay Borisov wrote: Using the macro makes the code more explicit and somewhat easier to comprehend. Signed-off-by: Nikolay Borisov --- block/blk-cbt.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/block/blk-cbt.c b/block/blk-cbt.c index