summaryrefslogtreecommitdiff
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-08-20 10:56:58 +0300
committerChristoph Hellwig <hch@lst.de>2020-10-07 08:56:17 +0300
commit6fcd669514794da08ce6bfa272b6ec9b33cb543d (patch)
tree4c68fb026fc5743d7f22bc8bbc6471eec4b53b7a /include/linux/blkdev.h
parent1401fcc4e3da97c44dcc7cbf538c07e24768d791 (diff)
downloadlinux-6fcd669514794da08ce6bfa272b6ec9b33cb543d.tar.xz
block: optimize blk_queue_zoned_model for !CONFIG_BLK_DEV_ZONED
Always return BLK_ZONED_NONE if zoned device support is not enabled. This allows various compiler optimizations including the dead code elimination that we so like for avoiding ifdefs. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 8e77f12de522..1b81b2766858 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -692,7 +692,9 @@ static inline bool queue_is_mq(struct request_queue *q)
static inline enum blk_zoned_model
blk_queue_zoned_model(struct request_queue *q)
{
- return q->limits.zoned;
+ if (IS_ENABLED(CONFIG_BLK_DEV_ZONED))
+ return q->limits.zoned;
+ return BLK_ZONED_NONE;
}
static inline bool blk_queue_is_zoned(struct request_queue *q)