Fix bdev_logical_block_size()

We were returning sectors instead of bytes.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
Kent Overstreet 2022-06-22 22:17:14 -04:00
parent 23dc00de78
commit b4afc1fa26

View File

@ -128,12 +128,10 @@ unsigned bdev_logical_block_size(struct block_device *bdev)
BUG_ON(ret);
if (!S_ISBLK(statbuf.st_mode))
return statbuf.st_blksize >> 9;
return statbuf.st_blksize;
ret = ioctl(bdev->bd_fd, BLKPBSZGET, &blksize);
BUG_ON(ret);
return blksize >> 9;
xioctl(bdev->bd_fd, BLKPBSZGET, &blksize);
return blksize;
}
sector_t get_capacity(struct gendisk *disk)