summaryrefslogtreecommitdiff
path: root/block/blk-mq-sched.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-10-12 18:17:59 +0200
committerJens Axboe <axboe@kernel.dk>2021-10-18 06:17:35 -0600
commit8addffd657a956944c1b8a74a1c9aabcfc5b4530 (patch)
treefdedec12ca19b388ef0be26160af8a407bc64fd4 /block/blk-mq-sched.h
parent11d9cab1ca6ed08747c6c5a274c6a8e8307aefbc (diff)
downloadlwn-8addffd657a956944c1b8a74a1c9aabcfc5b4530.tar.gz
lwn-8addffd657a956944c1b8a74a1c9aabcfc5b4530.zip
block: move bio_mergeable out of bio.h
bio_mergeable is only needed by I/O schedulers, so move it to blk-mq-sched.h. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20211012161804.991559-4-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq-sched.h')
-rw-r--r--block/blk-mq-sched.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h
index c97b816c3800..fe252278ed9a 100644
--- a/block/blk-mq-sched.h
+++ b/block/blk-mq-sched.h
@@ -37,6 +37,11 @@ static inline void blk_mq_sched_restart(struct blk_mq_hw_ctx *hctx)
__blk_mq_sched_restart(hctx);
}
+static inline bool bio_mergeable(struct bio *bio)
+{
+ return !(bio->bi_opf & REQ_NOMERGE_FLAGS);
+}
+
static inline bool
blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio,
unsigned int nr_segs)