block: mark blk-mq devices as stackable
authorMike Snitzer <snitzer@redhat.com>
Tue, 16 Dec 2014 17:54:25 +0000 (12:54 -0500)
committerJens Axboe <axboe@fb.com>
Wed, 28 Jan 2015 16:44:33 +0000 (09:44 -0700)
Commit 4ee5eaf4 ("block: add a queue flag for request stacking support")
introduced the concept of "STACKABLE" and blk-mq devices fit the
definition in that they establish q->request_fn.  So establish
QUEUE_FLAG_STACKABLE in QUEUE_FLAG_MQ_DEFAULT.

While not strictly needed (DM _could_ just check for q->mq_ops to assume
the device is request-based), request-based DM support for blk-mq devices
benefits from the ability to consistently check for QUEUE_FLAG_STACKABLE
before allowing a device to be stacked into a request-based DM table.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
include/linux/blkdev.h

index 6f388fd1c11c1c6775e935b0dd9816a8a1d0e34a..13e16401a7ce27dde3fb4cdce03b8e4e27d0c923 100644 (file)
@@ -520,6 +520,7 @@ struct request_queue {
                                 (1 << QUEUE_FLAG_ADD_RANDOM))
 
 #define QUEUE_FLAG_MQ_DEFAULT  ((1 << QUEUE_FLAG_IO_STAT) |            \
+                                (1 << QUEUE_FLAG_STACKABLE)    |       \
                                 (1 << QUEUE_FLAG_SAME_COMP))
 
 static inline void queue_lockdep_assert_held(struct request_queue *q)