diff mbox series

[3/8] block: move bio_mergeable out of bio.h

Message ID 20211012161804.991559-4-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/8] block: remove BIO_BUG_ON | expand

Commit Message

Christoph Hellwig Oct. 12, 2021, 4:17 p.m. UTC
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>
---
 block/blk-mq-sched.h | 5 +++++
 include/linux/bio.h  | 8 --------
 2 files changed, 5 insertions(+), 8 deletions(-)

Comments

Chaitanya Kulkarni Oct. 13, 2021, 4:20 a.m. UTC | #1
On 10/12/2021 9:17 AM, Christoph Hellwig wrote:
> 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>
> ---


Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
diff mbox series

Patch

diff --git a/block/blk-mq-sched.h b/block/blk-mq-sched.h
index e4d367e0b2a30..a38d593a5e7a9 100644
--- a/block/blk-mq-sched.h
+++ b/block/blk-mq-sched.h
@@ -31,6 +31,11 @@  int blk_mq_init_sched(struct request_queue *q, struct elevator_type *e);
 void blk_mq_exit_sched(struct request_queue *q, struct elevator_queue *e);
 void blk_mq_sched_free_rqs(struct request_queue *q);
 
+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)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index ae94794d07c9d..ec255f2829948 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -69,14 +69,6 @@  static inline bool bio_no_advance_iter(const struct bio *bio)
 	       bio_op(bio) == REQ_OP_WRITE_ZEROES;
 }
 
-static inline bool bio_mergeable(struct bio *bio)
-{
-	if (bio->bi_opf & REQ_NOMERGE_FLAGS)
-		return false;
-
-	return true;
-}
-
 static inline unsigned int bio_cur_bytes(struct bio *bio)
 {
 	if (bio_has_data(bio))