mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
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>
This commit is contained in:
parent
1beabab88e
commit
5476394aa9
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user