mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
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>
This commit is contained in:
parent
9baf50dfff
commit
39c3b4e7d0
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user