Skip to content

Commit 5ff9f19

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: simplify set_init_blocksize
The loop to increase the initial block size doesn't really make any sense, as the AND operation won't match for powers of two if it didn't for the initial block size. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 9011495 commit 5ff9f19

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

fs/block_dev.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,7 @@ EXPORT_SYMBOL(invalidate_bdev);
106106
static void set_init_blocksize(struct block_device *bdev)
107107
{
108108
unsigned bsize = bdev_logical_block_size(bdev);
109-
loff_t size = i_size_read(bdev->bd_inode);
110109

111-
while (bsize < PAGE_SIZE) {
112-
if (size & bsize)
113-
break;
114-
bsize <<= 1;
115-
}
116110
bdev->bd_block_size = bsize;
117111
bdev->bd_inode->i_blkbits = blksize_bits(bsize);
118112
}

0 commit comments

Comments
 (0)