]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
block: simplify queue_logical_block_size
authorChristoph Hellwig <hch@lst.de>
Thu, 27 Jun 2024 11:14:01 +0000 (13:14 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 28 Jun 2024 21:06:16 +0000 (15:06 -0600)
queue_logical_block_size is never called with a 0 queue, and the
logical_block_size field in queue_limits is always initialized for
a live queue.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240627111407.476276-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/blkdev.h

index 53c41ef4222c3d6a174e440232af5dfaf3dc643c..4d0d4b83bc740f6fb14e4ba78b77ed4a2bd0ded3 100644 (file)
@@ -1227,12 +1227,7 @@ static inline unsigned int bdev_max_segments(struct block_device *bdev)
 
 static inline unsigned queue_logical_block_size(const struct request_queue *q)
 {
-       int retval = 512;
-
-       if (q && q->limits.logical_block_size)
-               retval = q->limits.logical_block_size;
-
-       return retval;
+       return q->limits.logical_block_size;
 }
 
 static inline unsigned int bdev_logical_block_size(struct block_device *bdev)