[Drbd-dev] [Patch v0 2/8] Adapt pointer backing_dev_info in struct request_queue

Nick Wang nwang at suse.com
Tue Mar 7 04:27:53 CET 2017


In dc3b17cc, struct request_queue use pointer to backing_dev_info,
so all related call should be converted.

This patch is for drbd-kernel-compat

Signed-off-by: Nick Wang <nwang at suse.com>
CC: Philipp Reisner <philipp.reisner at linbit.com>
CC: Lars Ellenberg <lars.ellenberg at linbit.com>
CC: drbd-dev at lists.linbit.com 

---
 drbd_wrappers.h                       | 5 +++++
 tests/have_pointer_backing_dev_info.c | 7 +++++++
 2 files changed, 12 insertions(+)
 create mode 100644 tests/have_pointer_backing_dev_info.c

diff --git a/drbd_wrappers.h b/drbd_wrappers.h
index 0489e7f..778a6fd 100644
--- a/drbd_wrappers.h
+++ b/drbd_wrappers.h
@@ -888,6 +888,11 @@ static inline void blk_queue_write_cache(struct request_queue *q, bool enabled,
 #endif
 #endif
 
+#ifdef COMPAT_HAVE_POINTER_BACKING_DEV_INFO
+#define bdi_rw_congested(B) bdi_rw_congested(*(B))
+#define bdi_congested(B, C) bdi_congested(*(B), C)
+#endif
+
 #ifndef REQ_NOIDLE
 /* introduced in aeb6faf (2.6.30), relevant for CFQ */
 #define REQ_NOIDLE 0
diff --git a/tests/have_pointer_backing_dev_info.c b/tests/have_pointer_backing_dev_info.c
new file mode 100644
index 0000000..e9999ce
--- /dev/null
+++ b/tests/have_pointer_backing_dev_info.c
@@ -0,0 +1,7 @@
+#include <linux/blkdev.h>
+
+void test(void)
+{
+	struct request_queue q = {};
+	q.backing_dev_info = NULL;
+}
-- 
1.8.5.6



More information about the drbd-dev mailing list