diff options
author | Christoph Hellwig <hch@lst.de> | 2022-04-15 06:52:53 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-04-18 03:49:59 +0200 |
commit | e3cc28ea28b5f8794db2aed24f8a0282ad2e85a2 (patch) | |
tree | 725631a2f3bff8b70df2d269576529e5c37c91de /block/blk.h | |
parent | block: move {bdev,queue_limit}_discard_alignment out of line (diff) | |
download | linux-e3cc28ea28b5f8794db2aed24f8a0282ad2e85a2.tar.xz linux-e3cc28ea28b5f8794db2aed24f8a0282ad2e85a2.zip |
block: refactor discard bio size limiting
Move all the logic to limit the discard bio size into a common helper
so that it is better documented.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Coly Li <colyli@suse.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20220415045258.199825-23-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk.h')
-rw-r--r-- | block/blk.h | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/block/blk.h b/block/blk.h index 4ea5167dc339..434017701403 100644 --- a/block/blk.h +++ b/block/blk.h @@ -347,20 +347,6 @@ static inline unsigned int bio_allowed_max_sectors(struct request_queue *q) } /* - * The max bio size which is aligned to q->limits.discard_granularity. This - * is a hint to split large discard bio in generic block layer, then if device - * driver needs to split the discard bio into smaller ones, their bi_size can - * be very probably and easily aligned to discard_granularity of the device's - * queue. - */ -static inline unsigned int bio_aligned_discard_max_sectors( - struct request_queue *q) -{ - return round_down(UINT_MAX, q->limits.discard_granularity) >> - SECTOR_SHIFT; -} - -/* * Internal io_context interface */ struct io_cq *ioc_find_get_icq(struct request_queue *q); |