Commit fe4ec12e authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

floppy: use block_size

Use the block_size helper instead of open coding it.  Also remove the
check for a 0 block size, as that can't happen.
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 6e2fa4dd
...@@ -4205,7 +4205,6 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive) ...@@ -4205,7 +4205,6 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive)
struct bio_vec bio_vec; struct bio_vec bio_vec;
struct page *page; struct page *page;
struct rb0_cbdata cbdata; struct rb0_cbdata cbdata;
size_t size;
page = alloc_page(GFP_NOIO); page = alloc_page(GFP_NOIO);
if (!page) { if (!page) {
...@@ -4213,15 +4212,11 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive) ...@@ -4213,15 +4212,11 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive)
return -ENOMEM; return -ENOMEM;
} }
size = bdev->bd_block_size;
if (!size)
size = 1024;
cbdata.drive = drive; cbdata.drive = drive;
bio_init(&bio, &bio_vec, 1); bio_init(&bio, &bio_vec, 1);
bio_set_dev(&bio, bdev); bio_set_dev(&bio, bdev);
bio_add_page(&bio, page, size, 0); bio_add_page(&bio, page, block_size(bdev), 0);
bio.bi_iter.bi_sector = 0; bio.bi_iter.bi_sector = 0;
bio.bi_flags |= (1 << BIO_QUIET); bio.bi_flags |= (1 << BIO_QUIET);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment