]> www.infradead.org Git - users/hch/block.git/commitdiff
block: move bio_allowed_max_sectors to blk-merge.c
authorChristoph Hellwig <hch@lst.de>
Fri, 22 Jul 2022 07:00:23 +0000 (09:00 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 22 Jul 2022 07:15:57 +0000 (09:15 +0200)
Move this helper into the only file where it is used.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
block/blk-merge.c
block/blk.h

index 509ee8b5d3e1d9d666d266b608c8bf73a4c7ac9d..30652c51706d243a8287b9901050ac71e092a5ce 100644 (file)
@@ -95,6 +95,16 @@ static inline bool req_gap_front_merge(struct request *req, struct bio *bio)
        return bio_will_gap(req->q, NULL, bio, req->bio);
 }
 
+/*
+ * The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size
+ * is defined as 'unsigned int', meantime it has to be aligned to with the
+ * logical block size, which is the minimum accepted unit by hardware.
+ */
+static unsigned int bio_allowed_max_sectors(struct request_queue *q)
+{
+       return round_down(UINT_MAX, queue_logical_block_size(q)) >> 9;
+}
+
 static struct bio *bio_split_discard(struct bio *bio, struct request_queue *q,
                unsigned *nsegs, struct bio_set *bs)
 {
index f50c8fcded99e81cd0d39cbbf571eedb25bb9e1c..b3eda6c3917c1d044539fe176cf6351fad7d76a8 100644 (file)
@@ -344,16 +344,6 @@ static inline void req_set_nomerge(struct request_queue *q, struct request *req)
                q->last_merge = NULL;
 }
 
-/*
- * The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size
- * is defined as 'unsigned int', meantime it has to aligned to with logical
- * block size which is the minimum accepted unit by hardware.
- */
-static inline unsigned int bio_allowed_max_sectors(struct request_queue *q)
-{
-       return round_down(UINT_MAX, queue_logical_block_size(q)) >> 9;
-}
-
 /*
  * Internal io_context interface
  */