summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-06-27 14:14:01 +0300
committerJens Axboe <axboe@kernel.dk>2024-06-29 00:06:16 +0300
commit5476394aa9f27d670dd2bac426fdb6ac12b12cb3 (patch)
treeb149efd0019d56f653508c7ec89750ea33be213d
parent1beabab88ecee0698ecee7b54afa9cce7046ef96 (diff)
downloadlinux-5476394aa9f27d670dd2bac426fdb6ac12b12cb3.tar.xz
block: simplify queue_logical_block_size
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>
-rw-r--r--include/linux/blkdev.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 53c41ef4222c..4d0d4b83bc74 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -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)