blob: 887802d0dc5c32c88a47cb7199ef29b4fb2323b4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
diff --git a/Makefile-config b/Makefile-config
index d3e9a9a..8147f7d 100644
--- a/Makefile-config
+++ b/Makefile-config
@@ -86,4 +86,6 @@ EXTRA_CFLAGS += $(shell test -f $(srctree)/include/linux/blkdev.h && \
EXTRA_CFLAGS += $(shell test -f $(srctree)/include/linux/blkdev.h && \
grep -qw "void blk_queue_max_hw_sectors" $(srctree)/include/linux/blkdev.h && \
echo -D HAVE_BLK_QUEUE_MAX_HW_SECTORS)
-
+EXTRA_CFLAGS += $(shell test -f $(srctree)/include/linux/blk-mq.h && \
+ grep -qw "BLK_MQ_F_SHOULD_MERGE" $(srctree)/include/linux/blk-mq.h && \
+ echo -D HAVE_BLK_MQ_F_SHOULD_MERGE)
diff --git a/snapimage.c b/snapimage.c
index 0635636..bb0ca05 100644
--- a/snapimage.c
+++ b/snapimage.c
@@ -176,7 +176,11 @@ static inline int snapimage_alloc_tag_set(struct snapimage *snapimage)
set->nr_maps = 1;
set->queue_depth = 128;
set->numa_node = NUMA_NO_NODE;
+#ifdef HAVE_BLK_MQ_F_SHOULD_MERGE
set->flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_STACKING;
+#else
+ set->flags = BLK_MQ_F_STACKING;
+#endif
set->cmd_size = sizeof(struct snapimage_cmd);
set->driver_data = snapimage;
|