@@ -253,8 +253,7 @@ static int ntfs_zero_range(struct inode *inode, u64 vbo, u64 vbo_to)
253
253
*/
254
254
static int ntfs_file_mmap (struct file * file , struct vm_area_struct * vma )
255
255
{
256
- struct address_space * mapping = file -> f_mapping ;
257
- struct inode * inode = mapping -> host ;
256
+ struct inode * inode = file_inode (file );
258
257
struct ntfs_inode * ni = ntfs_i (inode );
259
258
u64 from = ((u64 )vma -> vm_pgoff << PAGE_SHIFT );
260
259
bool rw = vma -> vm_flags & VM_WRITE ;
@@ -428,7 +427,7 @@ static int ntfs_truncate(struct inode *inode, loff_t new_size)
428
427
*/
429
428
static long ntfs_fallocate (struct file * file , int mode , loff_t vbo , loff_t len )
430
429
{
431
- struct inode * inode = file -> f_mapping -> host ;
430
+ struct inode * inode = file_inode ( file ) ;
432
431
struct address_space * mapping = inode -> i_mapping ;
433
432
struct super_block * sb = inode -> i_sb ;
434
433
struct ntfs_sb_info * sbi = sb -> s_fs_info ;
@@ -741,7 +740,7 @@ int ntfs3_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
741
740
static ssize_t ntfs_file_read_iter (struct kiocb * iocb , struct iov_iter * iter )
742
741
{
743
742
struct file * file = iocb -> ki_filp ;
744
- struct inode * inode = file -> f_mapping -> host ;
743
+ struct inode * inode = file_inode ( file ) ;
745
744
struct ntfs_inode * ni = ntfs_i (inode );
746
745
747
746
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,
778
777
struct pipe_inode_info * pipe , size_t len ,
779
778
unsigned int flags )
780
779
{
781
- struct inode * inode = in -> f_mapping -> host ;
780
+ struct inode * inode = file_inode ( in ) ;
782
781
struct ntfs_inode * ni = ntfs_i (inode );
783
782
784
783
if (unlikely (ntfs3_forced_shutdown (inode -> i_sb )))
@@ -1073,8 +1072,7 @@ static ssize_t ntfs_compress_write(struct kiocb *iocb, struct iov_iter *from)
1073
1072
static ssize_t ntfs_file_write_iter (struct kiocb * iocb , struct iov_iter * from )
1074
1073
{
1075
1074
struct file * file = iocb -> ki_filp ;
1076
- struct address_space * mapping = file -> f_mapping ;
1077
- struct inode * inode = mapping -> host ;
1075
+ struct inode * inode = file_inode (file );
1078
1076
ssize_t ret ;
1079
1077
int err ;
1080
1078
struct ntfs_inode * ni = ntfs_i (inode );
0 commit comments