diff options
author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2024-06-17 13:56:03 +0200 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2024-07-11 11:19:45 +0200 |
commit | b9906f8162478c778c5212720efb19633a458ade (patch) | |
tree | ee91d9456d7809d65f186877d8c4c4b2bd1a39d9 /fs/ntfs3 | |
parent | fs/ntfs3: Minor ntfs_list_ea refactoring (diff) | |
download | linux-b9906f8162478c778c5212720efb19633a458ade.tar.xz linux-b9906f8162478c778c5212720efb19633a458ade.zip |
fs/ntfs3: Use function file_inode to get inode from file
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3')
-rw-r--r-- | fs/ntfs3/file.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index 35ca0f201cb8..2ceb762dc679 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -253,8 +253,7 @@ out: */ static int ntfs_file_mmap(struct file *file, struct vm_area_struct *vma) { - struct address_space *mapping = file->f_mapping; - struct inode *inode = mapping->host; + struct inode *inode = file_inode(file); struct ntfs_inode *ni = ntfs_i(inode); u64 from = ((u64)vma->vm_pgoff << PAGE_SHIFT); bool rw = vma->vm_flags & VM_WRITE; @@ -428,7 +427,7 @@ static int ntfs_truncate(struct inode *inode, loff_t new_size) */ static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len) { - struct inode *inode = file->f_mapping->host; + struct inode *inode = file_inode(file); struct address_space *mapping = inode->i_mapping; struct super_block *sb = inode->i_sb; struct ntfs_sb_info *sbi = sb->s_fs_info; @@ -741,7 +740,7 @@ out: static ssize_t ntfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter) { struct file *file = iocb->ki_filp; - struct inode *inode = file->f_mapping->host; + struct inode *inode = file_inode(file); struct ntfs_inode *ni = ntfs_i(inode); if (unlikely(ntfs3_forced_shutdown(inode->i_sb))) @@ -778,7 +777,7 @@ static ssize_t ntfs_file_splice_read(struct file *in, loff_t *ppos, struct pipe_inode_info *pipe, size_t len, unsigned int flags) { - struct inode *inode = in->f_mapping->host; + struct inode *inode = file_inode(in); struct ntfs_inode *ni = ntfs_i(inode); if (unlikely(ntfs3_forced_shutdown(inode->i_sb))) @@ -1073,8 +1072,7 @@ out: static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from) { struct file *file = iocb->ki_filp; - struct address_space *mapping = file->f_mapping; - struct inode *inode = mapping->host; + struct inode *inode = file_inode(file); ssize_t ret; int err; struct ntfs_inode *ni = ntfs_i(inode); |