[Devel] [PATCH RHEL9 COMMIT] blk-cbt: Don't open-code is_power_of_2() function
Konstantin Khorenko
khorenko at virtuozzo.com
Wed Feb 22 21:00:13 MSK 2023
The commit is pushed to "branch-rh9-5.14.0-162.6.1.vz9.18.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-162.6.1.vz9.18.11
------>
commit c7e772327120de1d84f52b8fec1a62b3d8573ce5
Author: Nikolay Borisov <nikolay.borisov at virtuozzo.com>
Date: Fri Jan 27 13:34:40 2023 +0200
blk-cbt: Don't open-code is_power_of_2() function
Fixes: ea18c5e9d2ba ("cbt: introduce changed block tracking")
Signed-off-by: Nikolay Borisov <nikolay.borisov at virtuozzo.com>
Reviewed-by: Alexander Atanasov <alexander.atanasov at virtuozzo.com>
---
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 a80fdeecd661..352eb9802e58 100644
--- a/block/blk-cbt.c
+++ b/block/blk-cbt.c
@@ -17,6 +17,7 @@
#include <linux/spinlock.h>
#include <linux/pagemap.h>
#include <linux/vmalloc.h>
+#include <linux/log2.h>
#include <asm/atomic.h>
#include <asm/uaccess.h>
@@ -626,7 +627,7 @@ static int cbt_ioc_init(struct block_device *bdev, struct blk_user_cbt_info __us
if (copy_from_user(&ci, ucbt_ioc, sizeof(ci)))
return -EFAULT;
- if (((ci.ci_blksize -1) & ci.ci_blksize))
+ if (!is_power_of_2(ci.ci_blksize))
return -EINVAL;
q = bdev_get_queue(bdev);
More information about the Devel
mailing list