summaryrefslogtreecommitdiff
path: root/block/fops.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2024-04-11 15:53:40 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2024-05-03 02:35:57 -0400
commit39c3b4e7d0a0d8876f29ea078b978b3caa924542 (patch)
tree97765e3cc03ce9a5e81384a7159d46147c524954 /block/fops.c
parent9baf50dfff1c55e704cae74c5f1c65f0fe254f1e (diff)
blkdev_write_iter(): saner way to get inode and bdev
... same as in other methods - bdev_file_inode() and I_BDEV() of that. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Link: https://lore.kernel.org/r/20240411145346.2516848-5-viro@zeniv.linux.org.uk Signed-off-by: Christian Brauner <brauner@kernel.org>
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 679d9b752fe8..9d0f36688a5d 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -668,8 +668,8 @@ static ssize_t blkdev_buffered_write(struct kiocb *iocb, struct iov_iter *from)
static ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from)
{
struct file *file = iocb->ki_filp;
- struct block_device *bdev = I_BDEV(file->f_mapping->host);
- struct inode *bd_inode = bdev->bd_inode;
+ struct inode *bd_inode = bdev_file_inode(file);
+ struct block_device *bdev = I_BDEV(bd_inode);
loff_t size = bdev_nr_bytes(bdev);
size_t shorted = 0;
ssize_t ret;