Skip to content

Commit 5476394

Browse files
Christoph Hellwigaxboe
authored andcommitted
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 <[email protected]> Reviewed-by: John Garry <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 1beabab commit 5476394

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

include/linux/blkdev.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,12 +1227,7 @@ static inline unsigned int bdev_max_segments(struct block_device *bdev)
12271227

12281228
static inline unsigned queue_logical_block_size(const struct request_queue *q)
12291229
{
1230-
int retval = 512;
1231-
1232-
if (q && q->limits.logical_block_size)
1233-
retval = q->limits.logical_block_size;
1234-
1235-
return retval;
1230+
return q->limits.logical_block_size;
12361231
}
12371232

12381233
static inline unsigned int bdev_logical_block_size(struct block_device *bdev)

0 commit comments

Comments
 (0)