Skip to content

Commit b6dc619

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: move bio_allowed_max_sectors to blk-merge.c
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> Link: https://lore.kernel.org/r/20220727162300.3089193-6-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent a85b363 commit b6dc619

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

block/blk-merge.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ static inline bool req_gap_front_merge(struct request *req, struct bio *bio)
9595
return bio_will_gap(req->q, NULL, bio, req->bio);
9696
}
9797

98+
/*
99+
* The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size
100+
* is defined as 'unsigned int', meantime it has to be aligned to with the
101+
* logical block size, which is the minimum accepted unit by hardware.
102+
*/
103+
static unsigned int bio_allowed_max_sectors(struct request_queue *q)
104+
{
105+
return round_down(UINT_MAX, queue_logical_block_size(q)) >> 9;
106+
}
107+
98108
static struct bio *bio_split_discard(struct bio *bio, struct request_queue *q,
99109
unsigned *nsegs, struct bio_set *bs)
100110
{

block/blk.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -344,16 +344,6 @@ static inline void req_set_nomerge(struct request_queue *q, struct request *req)
344344
q->last_merge = NULL;
345345
}
346346

347-
/*
348-
* The max size one bio can handle is UINT_MAX becasue bvec_iter.bi_size
349-
* is defined as 'unsigned int', meantime it has to aligned to with logical
350-
* block size which is the minimum accepted unit by hardware.
351-
*/
352-
static inline unsigned int bio_allowed_max_sectors(struct request_queue *q)
353-
{
354-
return round_down(UINT_MAX, queue_logical_block_size(q)) >> 9;
355-
}
356-
357347
/*
358348
* Internal io_context interface
359349
*/

0 commit comments

Comments
 (0)