summaryrefslogtreecommitdiff
path: root/block/fops.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-11-09 11:16:20 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2021-11-09 11:16:20 -0800
commit1dc1f92e24d6a5479ae8ceea3e2fac69f8d9dab7 (patch)
tree157795c66461605484ebec4d682d5e3285ba7b43 /block/fops.c
parent007301c472efd5c86e69e883dd889c555f131ab5 (diff)
parent138c1a38113d989416df57e9f8973c10c9e1fa04 (diff)
Merge tag 'for-5.16/bdev-size-2021-11-09' of git://git.kernel.dk/linux-block
Pull more bdev size updates from Jens Axboe: "Two followup changes for the bdev-size series from this merge window: - Add loff_t cast to bdev_nr_bytes() (Christoph) - Use bdev_nr_bytes() consistently for the block parts at least (me)" * tag 'for-5.16/bdev-size-2021-11-09' of git://git.kernel.dk/linux-block: block: use new bdev_nr_bytes() helper for blkdev_{read,write}_iter() block: add a loff_t cast to bdev_nr_bytes
Diffstat (limited to 'block/fops.c')
-rw-r--r--block/fops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/fops.c b/block/fops.c
index 4e22b0794c82..ad732a36f9b3 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -527,7 +527,7 @@ static ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from)
{
struct block_device *bdev = iocb->ki_filp->private_data;
struct inode *bd_inode = bdev->bd_inode;
- loff_t size = i_size_read(bd_inode);
+ loff_t size = bdev_nr_bytes(bdev);
struct blk_plug plug;
size_t shorted = 0;
ssize_t ret;
@@ -565,7 +565,7 @@ static ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from)
static ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to)
{
struct block_device *bdev = iocb->ki_filp->private_data;
- loff_t size = i_size_read(bdev->bd_inode);
+ loff_t size = bdev_nr_bytes(bdev);
loff_t pos = iocb->ki_pos;
size_t shorted = 0;
ssize_t ret;