diff mbox series

[2/8] block: use SECTOR_SHIFT bio_add_hw_page

Message ID 20230724165433.117645-3-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/8] block: tidy up the bio full checks in bio_add_hw_page | expand

Commit Message

Christoph Hellwig July 24, 2023, 4:54 p.m. UTC
Use the SECTOR_SHIFT magic constant instead of the magic number.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jinyoung Choi <j-young.choi@samsung.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 block/bio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/block/bio.c b/block/bio.c
index 72488ecea47acf..445be4bdd99bdb 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1007,7 +1007,7 @@  int bio_add_hw_page(struct request_queue *q, struct bio *bio,
 	if (WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED)))
 		return 0;
 
-	if (((bio->bi_iter.bi_size + len) >> 9) > max_sectors)
+	if (((bio->bi_iter.bi_size + len) >> SECTOR_SHIFT) > max_sectors)
 		return 0;
 
 	if (bio->bi_vcnt > 0) {