[Devel] [PATCH RHEL7 COMMIT] cbt/blkdev.h: fix compilation in case CONFIG_BLK_DEV_CBT is not set

Konstantin Khorenko khorenko at virtuozzo.com
Tue Oct 27 08:10:36 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.9.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.9.1
------>
commit f5519605294912bf3cf3b729aa32b3c4fc3c5a5f
Author: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
Date:   Tue Oct 27 19:10:32 2015 +0400

    cbt/blkdev.h: fix compilation in case CONFIG_BLK_DEV_CBT is not set
    
    Compilation errors:
    
    In file included from fs/block_dev.c:16:0:
    fs/block_dev.c: В функции «bd_write_size»:
    include/linux/blkdev.h:1649:32: ошибка: оператор без побочного эффекта
    [-Werror=unused-value]
     #define blk_cbt_update_size(b) (0)
                                    ^
    fs/block_dev.c:1043:2: замечание: in expansion of macro «blk_cbt_update_size»
      blk_cbt_update_size(bdev);
      ^
      CC      fs/ioprio.o
    
    Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 include/linux/blkdev.h | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 2a05818..0860be1 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1646,10 +1646,20 @@ extern void blk_cbt_release(struct request_queue *q);
 extern void blk_cbt_bio_queue(struct request_queue *q, struct bio *bio);
 extern int blk_cbt_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg);
 #else /* CONFIG_BLK_DEV_CBT */
-#define blk_cbt_update_size(b) (0)
-#define blk_cbt_release(q) (0)
-#define blk_cbt_bio_queue(q,bio) (0)
-#define blk_cbt_ioctl(b,c,a) (-ENOTTY)
+static inline void blk_cbt_update_size(struct block_device *bdev)
+{
+}
+static inline void blk_cbt_release(struct request_queue *q)
+{
+}
+static inline void blk_cbt_bio_queue(struct request_queue *q, struct bio *bio)
+{
+}
+static inline int blk_cbt_ioctl(struct block_device *bdev, unsigned cmd,
+				 char __user *arg)
+{
+	return 0;
+}
 #endif /* CONFIG_BLK_DEV_CBT */
 struct block_device_operations {
 	int (*open) (struct block_device *, fmode_t);



More information about the Devel mailing list