Skip to content

Commit 39c3b4e

Browse files
author
Al Viro
committed
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 9baf50d commit 39c3b4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

block/fops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,8 @@ static ssize_t blkdev_buffered_write(struct kiocb *iocb, struct iov_iter *from)
668668
static ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from)
669669
{
670670
struct file *file = iocb->ki_filp;
671-
struct block_device *bdev = I_BDEV(file->f_mapping->host);
672-
struct inode *bd_inode = bdev->bd_inode;
671+
struct inode *bd_inode = bdev_file_inode(file);
672+
struct block_device *bdev = I_BDEV(bd_inode);
673673
loff_t size = bdev_nr_bytes(bdev);
674674
size_t shorted = 0;
675675
ssize_t ret;

0 commit comments

Comments
 (0)