diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-01-23 17:07:38 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-22 23:31:31 -0500 |
commit | 496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch) | |
tree | 8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /fs | |
parent | 57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff) |
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
158 files changed, 373 insertions, 375 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index c2483e97beee..3356e3ed5115 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c | |||
@@ -133,7 +133,7 @@ out_error: | |||
133 | static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl) | 133 | static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl) |
134 | { | 134 | { |
135 | int res = 0; | 135 | int res = 0; |
136 | struct inode *inode = filp->f_path.dentry->d_inode; | 136 | struct inode *inode = file_inode(filp); |
137 | 137 | ||
138 | p9_debug(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl); | 138 | p9_debug(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl); |
139 | 139 | ||
@@ -302,7 +302,7 @@ static int v9fs_file_getlock(struct file *filp, struct file_lock *fl) | |||
302 | 302 | ||
303 | static int v9fs_file_lock_dotl(struct file *filp, int cmd, struct file_lock *fl) | 303 | static int v9fs_file_lock_dotl(struct file *filp, int cmd, struct file_lock *fl) |
304 | { | 304 | { |
305 | struct inode *inode = filp->f_path.dentry->d_inode; | 305 | struct inode *inode = file_inode(filp); |
306 | int ret = -ENOLCK; | 306 | int ret = -ENOLCK; |
307 | 307 | ||
308 | p9_debug(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n", | 308 | p9_debug(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n", |
@@ -338,7 +338,7 @@ out_err: | |||
338 | static int v9fs_file_flock_dotl(struct file *filp, int cmd, | 338 | static int v9fs_file_flock_dotl(struct file *filp, int cmd, |
339 | struct file_lock *fl) | 339 | struct file_lock *fl) |
340 | { | 340 | { |
341 | struct inode *inode = filp->f_path.dentry->d_inode; | 341 | struct inode *inode = file_inode(filp); |
342 | int ret = -ENOLCK; | 342 | int ret = -ENOLCK; |
343 | 343 | ||
344 | p9_debug(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n", | 344 | p9_debug(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n", |
@@ -529,7 +529,7 @@ v9fs_file_write(struct file *filp, const char __user * data, | |||
529 | if (!count) | 529 | if (!count) |
530 | goto out; | 530 | goto out; |
531 | 531 | ||
532 | retval = v9fs_file_write_internal(filp->f_path.dentry->d_inode, | 532 | retval = v9fs_file_write_internal(file_inode(filp), |
533 | filp->private_data, | 533 | filp->private_data, |
534 | data, count, &origin, 1); | 534 | data, count, &origin, 1); |
535 | /* update offset on successful write */ | 535 | /* update offset on successful write */ |
@@ -604,7 +604,7 @@ v9fs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
604 | struct v9fs_inode *v9inode; | 604 | struct v9fs_inode *v9inode; |
605 | struct page *page = vmf->page; | 605 | struct page *page = vmf->page; |
606 | struct file *filp = vma->vm_file; | 606 | struct file *filp = vma->vm_file; |
607 | struct inode *inode = filp->f_path.dentry->d_inode; | 607 | struct inode *inode = file_inode(filp); |
608 | 608 | ||
609 | 609 | ||
610 | p9_debug(P9_DEBUG_VFS, "page %p fid %lx\n", | 610 | p9_debug(P9_DEBUG_VFS, "page %p fid %lx\n", |
diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c index b3be2e7c5643..9cf874ce8336 100644 --- a/fs/adfs/dir.c +++ b/fs/adfs/dir.c | |||
@@ -19,7 +19,7 @@ static DEFINE_RWLOCK(adfs_dir_lock); | |||
19 | static int | 19 | static int |
20 | adfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | 20 | adfs_readdir(struct file *filp, void *dirent, filldir_t filldir) |
21 | { | 21 | { |
22 | struct inode *inode = filp->f_path.dentry->d_inode; | 22 | struct inode *inode = file_inode(filp); |
23 | struct super_block *sb = inode->i_sb; | 23 | struct super_block *sb = inode->i_sb; |
24 | struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir; | 24 | struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir; |
25 | struct object_info obj; | 25 | struct object_info obj; |
diff --git a/fs/affs/dir.c b/fs/affs/dir.c index 8ca8f3a55599..fd11a6d608ee 100644 --- a/fs/affs/dir.c +++ b/fs/affs/dir.c | |||
@@ -42,7 +42,7 @@ const struct inode_operations affs_dir_inode_operations = { | |||
42 | static int | 42 | static int |
43 | affs_readdir(struct file *filp, void *dirent, filldir_t filldir) | 43 | affs_readdir(struct file *filp, void *dirent, filldir_t filldir) |
44 | { | 44 | { |
45 | struct inode *inode = filp->f_path.dentry->d_inode; | 45 | struct inode *inode = file_inode(filp); |
46 | struct super_block *sb = inode->i_sb; | 46 | struct super_block *sb = inode->i_sb; |
47 | struct buffer_head *dir_bh; | 47 | struct buffer_head *dir_bh; |
48 | struct buffer_head *fh_bh; | 48 | struct buffer_head *fh_bh; |
diff --git a/fs/afs/dir.c b/fs/afs/dir.c index db477906ba4f..7a465ed04444 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c | |||
@@ -393,12 +393,12 @@ static int afs_readdir(struct file *file, void *cookie, filldir_t filldir) | |||
393 | int ret; | 393 | int ret; |
394 | 394 | ||
395 | _enter("{%Ld,{%lu}}", | 395 | _enter("{%Ld,{%lu}}", |
396 | file->f_pos, file->f_path.dentry->d_inode->i_ino); | 396 | file->f_pos, file_inode(file)->i_ino); |
397 | 397 | ||
398 | ASSERT(file->private_data != NULL); | 398 | ASSERT(file->private_data != NULL); |
399 | 399 | ||
400 | fpos = file->f_pos; | 400 | fpos = file->f_pos; |
401 | ret = afs_dir_iterate(file->f_path.dentry->d_inode, &fpos, | 401 | ret = afs_dir_iterate(file_inode(file), &fpos, |
402 | cookie, filldir, file->private_data); | 402 | cookie, filldir, file->private_data); |
403 | file->f_pos = fpos; | 403 | file->f_pos = fpos; |
404 | 404 | ||
diff --git a/fs/afs/flock.c b/fs/afs/flock.c index 757d664575dd..2497bf306c70 100644 --- a/fs/afs/flock.c +++ b/fs/afs/flock.c | |||
@@ -514,7 +514,7 @@ error: | |||
514 | */ | 514 | */ |
515 | int afs_lock(struct file *file, int cmd, struct file_lock *fl) | 515 | int afs_lock(struct file *file, int cmd, struct file_lock *fl) |
516 | { | 516 | { |
517 | struct afs_vnode *vnode = AFS_FS_I(file->f_dentry->d_inode); | 517 | struct afs_vnode *vnode = AFS_FS_I(file_inode(file)); |
518 | 518 | ||
519 | _enter("{%x:%u},%d,{t=%x,fl=%x,r=%Ld:%Ld}", | 519 | _enter("{%x:%u},%d,{t=%x,fl=%x,r=%Ld:%Ld}", |
520 | vnode->fid.vid, vnode->fid.vnode, cmd, | 520 | vnode->fid.vid, vnode->fid.vnode, cmd, |
@@ -537,7 +537,7 @@ int afs_lock(struct file *file, int cmd, struct file_lock *fl) | |||
537 | */ | 537 | */ |
538 | int afs_flock(struct file *file, int cmd, struct file_lock *fl) | 538 | int afs_flock(struct file *file, int cmd, struct file_lock *fl) |
539 | { | 539 | { |
540 | struct afs_vnode *vnode = AFS_FS_I(file->f_dentry->d_inode); | 540 | struct afs_vnode *vnode = AFS_FS_I(file_inode(file)); |
541 | 541 | ||
542 | _enter("{%x:%u},%d,{t=%x,fl=%x}", | 542 | _enter("{%x:%u},%d,{t=%x,fl=%x}", |
543 | vnode->fid.vid, vnode->fid.vnode, cmd, | 543 | vnode->fid.vid, vnode->fid.vnode, cmd, |
diff --git a/fs/afs/write.c b/fs/afs/write.c index 9aa52d93c73c..7e03eadb40c0 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c | |||
@@ -120,7 +120,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping, | |||
120 | struct page **pagep, void **fsdata) | 120 | struct page **pagep, void **fsdata) |
121 | { | 121 | { |
122 | struct afs_writeback *candidate, *wb; | 122 | struct afs_writeback *candidate, *wb; |
123 | struct afs_vnode *vnode = AFS_FS_I(file->f_dentry->d_inode); | 123 | struct afs_vnode *vnode = AFS_FS_I(file_inode(file)); |
124 | struct page *page; | 124 | struct page *page; |
125 | struct key *key = file->private_data; | 125 | struct key *key = file->private_data; |
126 | unsigned from = pos & (PAGE_CACHE_SIZE - 1); | 126 | unsigned from = pos & (PAGE_CACHE_SIZE - 1); |
@@ -245,7 +245,7 @@ int afs_write_end(struct file *file, struct address_space *mapping, | |||
245 | loff_t pos, unsigned len, unsigned copied, | 245 | loff_t pos, unsigned len, unsigned copied, |
246 | struct page *page, void *fsdata) | 246 | struct page *page, void *fsdata) |
247 | { | 247 | { |
248 | struct afs_vnode *vnode = AFS_FS_I(file->f_dentry->d_inode); | 248 | struct afs_vnode *vnode = AFS_FS_I(file_inode(file)); |
249 | loff_t i_size, maybe_i_size; | 249 | loff_t i_size, maybe_i_size; |
250 | 250 | ||
251 | _enter("{%x:%u},{%lx}", | 251 | _enter("{%x:%u},{%lx}", |
@@ -627,8 +627,7 @@ void afs_pages_written_back(struct afs_vnode *vnode, struct afs_call *call) | |||
627 | ssize_t afs_file_write(struct kiocb *iocb, const struct iovec *iov, | 627 | ssize_t afs_file_write(struct kiocb *iocb, const struct iovec *iov, |
628 | unsigned long nr_segs, loff_t pos) | 628 | unsigned long nr_segs, loff_t pos) |
629 | { | 629 | { |
630 | struct dentry *dentry = iocb->ki_filp->f_path.dentry; | 630 | struct afs_vnode *vnode = AFS_FS_I(file_inode(iocb->ki_filp)); |
631 | struct afs_vnode *vnode = AFS_FS_I(dentry->d_inode); | ||
632 | ssize_t result; | 631 | ssize_t result; |
633 | size_t count = iov_length(iov, nr_segs); | 632 | size_t count = iov_length(iov, nr_segs); |
634 | 633 | ||
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index b785e7707959..3f1128b37e46 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
@@ -273,7 +273,7 @@ static inline int autofs_prepare_pipe(struct file *pipe) | |||
273 | { | 273 | { |
274 | if (!pipe->f_op || !pipe->f_op->write) | 274 | if (!pipe->f_op || !pipe->f_op->write) |
275 | return -EINVAL; | 275 | return -EINVAL; |
276 | if (!S_ISFIFO(pipe->f_dentry->d_inode->i_mode)) | 276 | if (!S_ISFIFO(file_inode(pipe)->i_mode)) |
277 | return -EINVAL; | 277 | return -EINVAL; |
278 | /* We want a packet pipe */ | 278 | /* We want a packet pipe */ |
279 | pipe->f_flags |= O_DIRECT; | 279 | pipe->f_flags |= O_DIRECT; |
diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c index 9f68a37bb2b2..743c7c2c949d 100644 --- a/fs/autofs4/dev-ioctl.c +++ b/fs/autofs4/dev-ioctl.c | |||
@@ -159,7 +159,7 @@ static struct autofs_sb_info *autofs_dev_ioctl_sbi(struct file *f) | |||
159 | struct inode *inode; | 159 | struct inode *inode; |
160 | 160 | ||
161 | if (f) { | 161 | if (f) { |
162 | inode = f->f_path.dentry->d_inode; | 162 | inode = file_inode(f); |
163 | sbi = autofs4_sbi(inode->i_sb); | 163 | sbi = autofs4_sbi(inode->i_sb); |
164 | } | 164 | } |
165 | return sbi; | 165 | return sbi; |
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index c93447604da8..3cdf835e8b49 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -874,7 +874,7 @@ static int autofs4_root_ioctl_unlocked(struct inode *inode, struct file *filp, | |||
874 | static long autofs4_root_ioctl(struct file *filp, | 874 | static long autofs4_root_ioctl(struct file *filp, |
875 | unsigned int cmd, unsigned long arg) | 875 | unsigned int cmd, unsigned long arg) |
876 | { | 876 | { |
877 | struct inode *inode = filp->f_dentry->d_inode; | 877 | struct inode *inode = file_inode(filp); |
878 | return autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); | 878 | return autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); |
879 | } | 879 | } |
880 | 880 | ||
@@ -882,7 +882,7 @@ static long autofs4_root_ioctl(struct file *filp, | |||
882 | static long autofs4_root_compat_ioctl(struct file *filp, | 882 | static long autofs4_root_compat_ioctl(struct file *filp, |
883 | unsigned int cmd, unsigned long arg) | 883 | unsigned int cmd, unsigned long arg) |
884 | { | 884 | { |
885 | struct inode *inode = filp->f_path.dentry->d_inode; | 885 | struct inode *inode = file_inode(filp); |
886 | int ret; | 886 | int ret; |
887 | 887 | ||
888 | if (cmd == AUTOFS_IOC_READY || cmd == AUTOFS_IOC_FAIL) | 888 | if (cmd == AUTOFS_IOC_READY || cmd == AUTOFS_IOC_FAIL) |
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index 2b3bda8d5e68..c8f4e25eb9e2 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c | |||
@@ -213,7 +213,7 @@ befs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) | |||
213 | static int | 213 | static int |
214 | befs_readdir(struct file *filp, void *dirent, filldir_t filldir) | 214 | befs_readdir(struct file *filp, void *dirent, filldir_t filldir) |
215 | { | 215 | { |
216 | struct inode *inode = filp->f_path.dentry->d_inode; | 216 | struct inode *inode = file_inode(filp); |
217 | struct super_block *sb = inode->i_sb; | 217 | struct super_block *sb = inode->i_sb; |
218 | befs_data_stream *ds = &BEFS_I(inode)->i_data.ds; | 218 | befs_data_stream *ds = &BEFS_I(inode)->i_data.ds; |
219 | befs_off_t value; | 219 | befs_off_t value; |
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index 2785ef91191a..3f422f6bb5ca 100644 --- a/fs/bfs/dir.c +++ b/fs/bfs/dir.c | |||
@@ -28,7 +28,7 @@ static struct buffer_head *bfs_find_entry(struct inode *dir, | |||
28 | 28 | ||
29 | static int bfs_readdir(struct file *f, void *dirent, filldir_t filldir) | 29 | static int bfs_readdir(struct file *f, void *dirent, filldir_t filldir) |
30 | { | 30 | { |
31 | struct inode *dir = f->f_path.dentry->d_inode; | 31 | struct inode *dir = file_inode(f); |
32 | struct buffer_head *bh; | 32 | struct buffer_head *bh; |
33 | struct bfs_dirent *de; | 33 | struct bfs_dirent *de; |
34 | struct bfs_sb_info *info = BFS_SB(dir->i_sb); | 34 | struct bfs_sb_info *info = BFS_SB(dir->i_sb); |
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c index 6043567b95c2..bbc8f8827eac 100644 --- a/fs/binfmt_aout.c +++ b/fs/binfmt_aout.c | |||
@@ -214,7 +214,7 @@ static int load_aout_binary(struct linux_binprm * bprm) | |||
214 | if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && | 214 | if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && |
215 | N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) || | 215 | N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) || |
216 | N_TRSIZE(ex) || N_DRSIZE(ex) || | 216 | N_TRSIZE(ex) || N_DRSIZE(ex) || |
217 | i_size_read(bprm->file->f_path.dentry->d_inode) < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { | 217 | i_size_read(file_inode(bprm->file)) < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { |
218 | return -ENOEXEC; | 218 | return -ENOEXEC; |
219 | } | 219 | } |
220 | 220 | ||
@@ -367,7 +367,7 @@ static int load_aout_library(struct file *file) | |||
367 | int retval; | 367 | int retval; |
368 | struct exec ex; | 368 | struct exec ex; |
369 | 369 | ||
370 | inode = file->f_path.dentry->d_inode; | 370 | inode = file_inode(file); |
371 | 371 | ||
372 | retval = -ENOEXEC; | 372 | retval = -ENOEXEC; |
373 | error = kernel_read(file, 0, (char *) &ex, sizeof(ex)); | 373 | error = kernel_read(file, 0, (char *) &ex, sizeof(ex)); |
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 0c42cdbabecf..11e078a747a5 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
@@ -1140,7 +1140,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma, | |||
1140 | 1140 | ||
1141 | /* By default, dump shared memory if mapped from an anonymous file. */ | 1141 | /* By default, dump shared memory if mapped from an anonymous file. */ |
1142 | if (vma->vm_flags & VM_SHARED) { | 1142 | if (vma->vm_flags & VM_SHARED) { |
1143 | if (vma->vm_file->f_path.dentry->d_inode->i_nlink == 0 ? | 1143 | if (file_inode(vma->vm_file)->i_nlink == 0 ? |
1144 | FILTER(ANON_SHARED) : FILTER(MAPPED_SHARED)) | 1144 | FILTER(ANON_SHARED) : FILTER(MAPPED_SHARED)) |
1145 | goto whole; | 1145 | goto whole; |
1146 | return 0; | 1146 | return 0; |
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index dc84732e554f..30de01ca3eeb 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c | |||
@@ -909,7 +909,7 @@ static int elf_fdpic_map_file(struct elf_fdpic_params *params, | |||
909 | 909 | ||
910 | dynamic_error: | 910 | dynamic_error: |
911 | printk("ELF FDPIC %s with invalid DYNAMIC section (inode=%lu)\n", | 911 | printk("ELF FDPIC %s with invalid DYNAMIC section (inode=%lu)\n", |
912 | what, file->f_path.dentry->d_inode->i_ino); | 912 | what, file_inode(file)->i_ino); |
913 | return -ELIBBAD; | 913 | return -ELIBBAD; |
914 | } | 914 | } |
915 | 915 | ||
@@ -1219,7 +1219,7 @@ static int maydump(struct vm_area_struct *vma, unsigned long mm_flags) | |||
1219 | 1219 | ||
1220 | /* By default, dump shared memory if mapped from an anonymous file. */ | 1220 | /* By default, dump shared memory if mapped from an anonymous file. */ |
1221 | if (vma->vm_flags & VM_SHARED) { | 1221 | if (vma->vm_flags & VM_SHARED) { |
1222 | if (vma->vm_file->f_path.dentry->d_inode->i_nlink == 0) { | 1222 | if (file_inode(vma->vm_file)->i_nlink == 0) { |
1223 | dump_ok = test_bit(MMF_DUMP_ANON_SHARED, &mm_flags); | 1223 | dump_ok = test_bit(MMF_DUMP_ANON_SHARED, &mm_flags); |
1224 | kdcore("%08lx: %08lx: %s (share)", vma->vm_start, | 1224 | kdcore("%08lx: %08lx: %s (share)", vma->vm_start, |
1225 | vma->vm_flags, dump_ok ? "yes" : "no"); | 1225 | vma->vm_flags, dump_ok ? "yes" : "no"); |
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c index b56371981d16..2036d21baaef 100644 --- a/fs/binfmt_flat.c +++ b/fs/binfmt_flat.c | |||
@@ -438,7 +438,7 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
438 | int ret; | 438 | int ret; |
439 | 439 | ||
440 | hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */ | 440 | hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */ |
441 | inode = bprm->file->f_path.dentry->d_inode; | 441 | inode = file_inode(bprm->file); |
442 | 442 | ||
443 | text_len = ntohl(hdr->data_start); | 443 | text_len = ntohl(hdr->data_start); |
444 | data_len = ntohl(hdr->data_end) - ntohl(hdr->data_start); | 444 | data_len = ntohl(hdr->data_end) - ntohl(hdr->data_start); |
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 0c8869fdd14e..fecbbf3f8ff2 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c | |||
@@ -531,7 +531,7 @@ static void kill_node(Node *e) | |||
531 | static ssize_t | 531 | static ssize_t |
532 | bm_entry_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) | 532 | bm_entry_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) |
533 | { | 533 | { |
534 | Node *e = file->f_path.dentry->d_inode->i_private; | 534 | Node *e = file_inode(file)->i_private; |
535 | ssize_t res; | 535 | ssize_t res; |
536 | char *page; | 536 | char *page; |
537 | 537 | ||
@@ -550,7 +550,7 @@ static ssize_t bm_entry_write(struct file *file, const char __user *buffer, | |||
550 | size_t count, loff_t *ppos) | 550 | size_t count, loff_t *ppos) |
551 | { | 551 | { |
552 | struct dentry *root; | 552 | struct dentry *root; |
553 | Node *e = file->f_path.dentry->d_inode->i_private; | 553 | Node *e = file_inode(file)->i_private; |
554 | int res = parse_command(buffer, count); | 554 | int res = parse_command(buffer, count); |
555 | 555 | ||
556 | switch (res) { | 556 | switch (res) { |
diff --git a/fs/block_dev.c b/fs/block_dev.c index 172f8491a2bd..7d6bdfc6b7bc 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -318,7 +318,7 @@ static int blkdev_write_end(struct file *file, struct address_space *mapping, | |||
318 | 318 | ||
319 | /* | 319 | /* |
320 | * private llseek: | 320 | * private llseek: |
321 | * for a block special file file->f_path.dentry->d_inode->i_size is zero | 321 | * for a block special file file_inode(file)->i_size is zero |
322 | * so we compute the size by hand (just as in block_read/write above) | 322 | * so we compute the size by hand (just as in block_read/write above) |
323 | */ | 323 | */ |
324 | static loff_t block_llseek(struct file *file, loff_t offset, int whence) | 324 | static loff_t block_llseek(struct file *file, loff_t offset, int whence) |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 77061bf43edb..4118e0b6e339 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -1211,7 +1211,7 @@ static noinline int prepare_pages(struct btrfs_root *root, struct file *file, | |||
1211 | struct extent_state *cached_state = NULL; | 1211 | struct extent_state *cached_state = NULL; |
1212 | int i; | 1212 | int i; |
1213 | unsigned long index = pos >> PAGE_CACHE_SHIFT; | 1213 | unsigned long index = pos >> PAGE_CACHE_SHIFT; |
1214 | struct inode *inode = fdentry(file)->d_inode; | 1214 | struct inode *inode = file_inode(file); |
1215 | gfp_t mask = btrfs_alloc_write_mask(inode->i_mapping); | 1215 | gfp_t mask = btrfs_alloc_write_mask(inode->i_mapping); |
1216 | int err = 0; | 1216 | int err = 0; |
1217 | int faili = 0; | 1217 | int faili = 0; |
@@ -1298,7 +1298,7 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file, | |||
1298 | struct iov_iter *i, | 1298 | struct iov_iter *i, |
1299 | loff_t pos) | 1299 | loff_t pos) |
1300 | { | 1300 | { |
1301 | struct inode *inode = fdentry(file)->d_inode; | 1301 | struct inode *inode = file_inode(file); |
1302 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1302 | struct btrfs_root *root = BTRFS_I(inode)->root; |
1303 | struct page **pages = NULL; | 1303 | struct page **pages = NULL; |
1304 | unsigned long first_index; | 1304 | unsigned long first_index; |
@@ -1486,7 +1486,7 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb, | |||
1486 | unsigned long nr_segs, loff_t pos) | 1486 | unsigned long nr_segs, loff_t pos) |
1487 | { | 1487 | { |
1488 | struct file *file = iocb->ki_filp; | 1488 | struct file *file = iocb->ki_filp; |
1489 | struct inode *inode = fdentry(file)->d_inode; | 1489 | struct inode *inode = file_inode(file); |
1490 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1490 | struct btrfs_root *root = BTRFS_I(inode)->root; |
1491 | loff_t *ppos = &iocb->ki_pos; | 1491 | loff_t *ppos = &iocb->ki_pos; |
1492 | u64 start_pos; | 1492 | u64 start_pos; |
@@ -2087,7 +2087,7 @@ out: | |||
2087 | static long btrfs_fallocate(struct file *file, int mode, | 2087 | static long btrfs_fallocate(struct file *file, int mode, |
2088 | loff_t offset, loff_t len) | 2088 | loff_t offset, loff_t len) |
2089 | { | 2089 | { |
2090 | struct inode *inode = file->f_path.dentry->d_inode; | 2090 | struct inode *inode = file_inode(file); |
2091 | struct extent_state *cached_state = NULL; | 2091 | struct extent_state *cached_state = NULL; |
2092 | u64 cur_offset; | 2092 | u64 cur_offset; |
2093 | u64 last_byte; | 2093 | u64 last_byte; |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 16d9e8e191e6..02d946a61ddd 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -4342,7 +4342,7 @@ unsigned char btrfs_filetype_table[] = { | |||
4342 | static int btrfs_real_readdir(struct file *filp, void *dirent, | 4342 | static int btrfs_real_readdir(struct file *filp, void *dirent, |
4343 | filldir_t filldir) | 4343 | filldir_t filldir) |
4344 | { | 4344 | { |
4345 | struct inode *inode = filp->f_dentry->d_inode; | 4345 | struct inode *inode = file_inode(filp); |
4346 | struct btrfs_root *root = BTRFS_I(inode)->root; | 4346 | struct btrfs_root *root = BTRFS_I(inode)->root; |
4347 | struct btrfs_item *item; | 4347 | struct btrfs_item *item; |
4348 | struct btrfs_dir_item *di; | 4348 | struct btrfs_dir_item *di; |
@@ -6737,7 +6737,7 @@ static void btrfs_invalidatepage(struct page *page, unsigned long offset) | |||
6737 | int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | 6737 | int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) |
6738 | { | 6738 | { |
6739 | struct page *page = vmf->page; | 6739 | struct page *page = vmf->page; |
6740 | struct inode *inode = fdentry(vma->vm_file)->d_inode; | 6740 | struct inode *inode = file_inode(vma->vm_file); |
6741 | struct btrfs_root *root = BTRFS_I(inode)->root; | 6741 | struct btrfs_root *root = BTRFS_I(inode)->root; |
6742 | struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; | 6742 | struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; |
6743 | struct btrfs_ordered_extent *ordered; | 6743 | struct btrfs_ordered_extent *ordered; |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4b4516770f05..61045adc3075 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -152,7 +152,7 @@ void btrfs_inherit_iflags(struct inode *inode, struct inode *dir) | |||
152 | 152 | ||
153 | static int btrfs_ioctl_getflags(struct file *file, void __user *arg) | 153 | static int btrfs_ioctl_getflags(struct file *file, void __user *arg) |
154 | { | 154 | { |
155 | struct btrfs_inode *ip = BTRFS_I(file->f_path.dentry->d_inode); | 155 | struct btrfs_inode *ip = BTRFS_I(file_inode(file)); |
156 | unsigned int flags = btrfs_flags_to_ioctl(ip->flags); | 156 | unsigned int flags = btrfs_flags_to_ioctl(ip->flags); |
157 | 157 | ||
158 | if (copy_to_user(arg, &flags, sizeof(flags))) | 158 | if (copy_to_user(arg, &flags, sizeof(flags))) |
@@ -177,7 +177,7 @@ static int check_flags(unsigned int flags) | |||
177 | 177 | ||
178 | static int btrfs_ioctl_setflags(struct file *file, void __user *arg) | 178 | static int btrfs_ioctl_setflags(struct file *file, void __user *arg) |
179 | { | 179 | { |
180 | struct inode *inode = file->f_path.dentry->d_inode; | 180 | struct inode *inode = file_inode(file); |
181 | struct btrfs_inode *ip = BTRFS_I(inode); | 181 | struct btrfs_inode *ip = BTRFS_I(inode); |
182 | struct btrfs_root *root = ip->root; | 182 | struct btrfs_root *root = ip->root; |
183 | struct btrfs_trans_handle *trans; | 183 | struct btrfs_trans_handle *trans; |
@@ -310,7 +310,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) | |||
310 | 310 | ||
311 | static int btrfs_ioctl_getversion(struct file *file, int __user *arg) | 311 | static int btrfs_ioctl_getversion(struct file *file, int __user *arg) |
312 | { | 312 | { |
313 | struct inode *inode = file->f_path.dentry->d_inode; | 313 | struct inode *inode = file_inode(file); |
314 | 314 | ||
315 | return put_user(inode->i_generation, arg); | 315 | return put_user(inode->i_generation, arg); |
316 | } | 316 | } |
@@ -1317,7 +1317,7 @@ static noinline int btrfs_ioctl_resize(struct file *file, | |||
1317 | u64 new_size; | 1317 | u64 new_size; |
1318 | u64 old_size; | 1318 | u64 old_size; |
1319 | u64 devid = 1; | 1319 | u64 devid = 1; |
1320 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 1320 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
1321 | struct btrfs_ioctl_vol_args *vol_args; | 1321 | struct btrfs_ioctl_vol_args *vol_args; |
1322 | struct btrfs_trans_handle *trans; | 1322 | struct btrfs_trans_handle *trans; |
1323 | struct btrfs_device *device = NULL; | 1323 | struct btrfs_device *device = NULL; |
@@ -1483,8 +1483,8 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file, | |||
1483 | goto out_drop_write; | 1483 | goto out_drop_write; |
1484 | } | 1484 | } |
1485 | 1485 | ||
1486 | src_inode = src.file->f_path.dentry->d_inode; | 1486 | src_inode = file_inode(src.file); |
1487 | if (src_inode->i_sb != file->f_path.dentry->d_inode->i_sb) { | 1487 | if (src_inode->i_sb != file_inode(file)->i_sb) { |
1488 | printk(KERN_INFO "btrfs: Snapshot src from " | 1488 | printk(KERN_INFO "btrfs: Snapshot src from " |
1489 | "another FS\n"); | 1489 | "another FS\n"); |
1490 | ret = -EINVAL; | 1490 | ret = -EINVAL; |
@@ -1576,7 +1576,7 @@ out: | |||
1576 | static noinline int btrfs_ioctl_subvol_getflags(struct file *file, | 1576 | static noinline int btrfs_ioctl_subvol_getflags(struct file *file, |
1577 | void __user *arg) | 1577 | void __user *arg) |
1578 | { | 1578 | { |
1579 | struct inode *inode = fdentry(file)->d_inode; | 1579 | struct inode *inode = file_inode(file); |
1580 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1580 | struct btrfs_root *root = BTRFS_I(inode)->root; |
1581 | int ret = 0; | 1581 | int ret = 0; |
1582 | u64 flags = 0; | 1582 | u64 flags = 0; |
@@ -1598,7 +1598,7 @@ static noinline int btrfs_ioctl_subvol_getflags(struct file *file, | |||
1598 | static noinline int btrfs_ioctl_subvol_setflags(struct file *file, | 1598 | static noinline int btrfs_ioctl_subvol_setflags(struct file *file, |
1599 | void __user *arg) | 1599 | void __user *arg) |
1600 | { | 1600 | { |
1601 | struct inode *inode = fdentry(file)->d_inode; | 1601 | struct inode *inode = file_inode(file); |
1602 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1602 | struct btrfs_root *root = BTRFS_I(inode)->root; |
1603 | struct btrfs_trans_handle *trans; | 1603 | struct btrfs_trans_handle *trans; |
1604 | u64 root_flags; | 1604 | u64 root_flags; |
@@ -1892,7 +1892,7 @@ static noinline int btrfs_ioctl_tree_search(struct file *file, | |||
1892 | if (IS_ERR(args)) | 1892 | if (IS_ERR(args)) |
1893 | return PTR_ERR(args); | 1893 | return PTR_ERR(args); |
1894 | 1894 | ||
1895 | inode = fdentry(file)->d_inode; | 1895 | inode = file_inode(file); |
1896 | ret = search_ioctl(inode, args); | 1896 | ret = search_ioctl(inode, args); |
1897 | if (ret == 0 && copy_to_user(argp, args, sizeof(*args))) | 1897 | if (ret == 0 && copy_to_user(argp, args, sizeof(*args))) |
1898 | ret = -EFAULT; | 1898 | ret = -EFAULT; |
@@ -2002,7 +2002,7 @@ static noinline int btrfs_ioctl_ino_lookup(struct file *file, | |||
2002 | if (IS_ERR(args)) | 2002 | if (IS_ERR(args)) |
2003 | return PTR_ERR(args); | 2003 | return PTR_ERR(args); |
2004 | 2004 | ||
2005 | inode = fdentry(file)->d_inode; | 2005 | inode = file_inode(file); |
2006 | 2006 | ||
2007 | if (args->treeid == 0) | 2007 | if (args->treeid == 0) |
2008 | args->treeid = BTRFS_I(inode)->root->root_key.objectid; | 2008 | args->treeid = BTRFS_I(inode)->root->root_key.objectid; |
@@ -2178,7 +2178,7 @@ out: | |||
2178 | 2178 | ||
2179 | static int btrfs_ioctl_defrag(struct file *file, void __user *argp) | 2179 | static int btrfs_ioctl_defrag(struct file *file, void __user *argp) |
2180 | { | 2180 | { |
2181 | struct inode *inode = fdentry(file)->d_inode; | 2181 | struct inode *inode = file_inode(file); |
2182 | struct btrfs_root *root = BTRFS_I(inode)->root; | 2182 | struct btrfs_root *root = BTRFS_I(inode)->root; |
2183 | struct btrfs_ioctl_defrag_range_args *range; | 2183 | struct btrfs_ioctl_defrag_range_args *range; |
2184 | int ret; | 2184 | int ret; |
@@ -2237,7 +2237,7 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp) | |||
2237 | /* the rest are all set to zero by kzalloc */ | 2237 | /* the rest are all set to zero by kzalloc */ |
2238 | range->len = (u64)-1; | 2238 | range->len = (u64)-1; |
2239 | } | 2239 | } |
2240 | ret = btrfs_defrag_file(fdentry(file)->d_inode, file, | 2240 | ret = btrfs_defrag_file(file_inode(file), file, |
2241 | range, 0, 0); | 2241 | range, 0, 0); |
2242 | if (ret > 0) | 2242 | if (ret > 0) |
2243 | ret = 0; | 2243 | ret = 0; |
@@ -2285,7 +2285,7 @@ out: | |||
2285 | 2285 | ||
2286 | static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg) | 2286 | static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg) |
2287 | { | 2287 | { |
2288 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 2288 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
2289 | struct btrfs_ioctl_vol_args *vol_args; | 2289 | struct btrfs_ioctl_vol_args *vol_args; |
2290 | int ret; | 2290 | int ret; |
2291 | 2291 | ||
@@ -2408,7 +2408,7 @@ out: | |||
2408 | static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, | 2408 | static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, |
2409 | u64 off, u64 olen, u64 destoff) | 2409 | u64 off, u64 olen, u64 destoff) |
2410 | { | 2410 | { |
2411 | struct inode *inode = fdentry(file)->d_inode; | 2411 | struct inode *inode = file_inode(file); |
2412 | struct btrfs_root *root = BTRFS_I(inode)->root; | 2412 | struct btrfs_root *root = BTRFS_I(inode)->root; |
2413 | struct fd src_file; | 2413 | struct fd src_file; |
2414 | struct inode *src; | 2414 | struct inode *src; |
@@ -2454,7 +2454,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, | |||
2454 | if (src_file.file->f_path.mnt != file->f_path.mnt) | 2454 | if (src_file.file->f_path.mnt != file->f_path.mnt) |
2455 | goto out_fput; | 2455 | goto out_fput; |
2456 | 2456 | ||
2457 | src = src_file.file->f_dentry->d_inode; | 2457 | src = file_inode(src_file.file); |
2458 | 2458 | ||
2459 | ret = -EINVAL; | 2459 | ret = -EINVAL; |
2460 | if (src == inode) | 2460 | if (src == inode) |
@@ -2816,7 +2816,7 @@ static long btrfs_ioctl_clone_range(struct file *file, void __user *argp) | |||
2816 | */ | 2816 | */ |
2817 | static long btrfs_ioctl_trans_start(struct file *file) | 2817 | static long btrfs_ioctl_trans_start(struct file *file) |
2818 | { | 2818 | { |
2819 | struct inode *inode = fdentry(file)->d_inode; | 2819 | struct inode *inode = file_inode(file); |
2820 | struct btrfs_root *root = BTRFS_I(inode)->root; | 2820 | struct btrfs_root *root = BTRFS_I(inode)->root; |
2821 | struct btrfs_trans_handle *trans; | 2821 | struct btrfs_trans_handle *trans; |
2822 | int ret; | 2822 | int ret; |
@@ -2856,7 +2856,7 @@ out: | |||
2856 | 2856 | ||
2857 | static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) | 2857 | static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) |
2858 | { | 2858 | { |
2859 | struct inode *inode = fdentry(file)->d_inode; | 2859 | struct inode *inode = file_inode(file); |
2860 | struct btrfs_root *root = BTRFS_I(inode)->root; | 2860 | struct btrfs_root *root = BTRFS_I(inode)->root; |
2861 | struct btrfs_root *new_root; | 2861 | struct btrfs_root *new_root; |
2862 | struct btrfs_dir_item *di; | 2862 | struct btrfs_dir_item *di; |
@@ -3080,7 +3080,7 @@ out: | |||
3080 | */ | 3080 | */ |
3081 | long btrfs_ioctl_trans_end(struct file *file) | 3081 | long btrfs_ioctl_trans_end(struct file *file) |
3082 | { | 3082 | { |
3083 | struct inode *inode = fdentry(file)->d_inode; | 3083 | struct inode *inode = file_inode(file); |
3084 | struct btrfs_root *root = BTRFS_I(inode)->root; | 3084 | struct btrfs_root *root = BTRFS_I(inode)->root; |
3085 | struct btrfs_trans_handle *trans; | 3085 | struct btrfs_trans_handle *trans; |
3086 | 3086 | ||
@@ -3142,7 +3142,7 @@ static noinline long btrfs_ioctl_wait_sync(struct btrfs_root *root, | |||
3142 | 3142 | ||
3143 | static long btrfs_ioctl_scrub(struct file *file, void __user *arg) | 3143 | static long btrfs_ioctl_scrub(struct file *file, void __user *arg) |
3144 | { | 3144 | { |
3145 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 3145 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
3146 | struct btrfs_ioctl_scrub_args *sa; | 3146 | struct btrfs_ioctl_scrub_args *sa; |
3147 | int ret; | 3147 | int ret; |
3148 | 3148 | ||
@@ -3433,7 +3433,7 @@ void update_ioctl_balance_args(struct btrfs_fs_info *fs_info, int lock, | |||
3433 | 3433 | ||
3434 | static long btrfs_ioctl_balance(struct file *file, void __user *arg) | 3434 | static long btrfs_ioctl_balance(struct file *file, void __user *arg) |
3435 | { | 3435 | { |
3436 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 3436 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
3437 | struct btrfs_fs_info *fs_info = root->fs_info; | 3437 | struct btrfs_fs_info *fs_info = root->fs_info; |
3438 | struct btrfs_ioctl_balance_args *bargs; | 3438 | struct btrfs_ioctl_balance_args *bargs; |
3439 | struct btrfs_balance_control *bctl; | 3439 | struct btrfs_balance_control *bctl; |
@@ -3573,7 +3573,7 @@ out: | |||
3573 | 3573 | ||
3574 | static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg) | 3574 | static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg) |
3575 | { | 3575 | { |
3576 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 3576 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
3577 | struct btrfs_ioctl_quota_ctl_args *sa; | 3577 | struct btrfs_ioctl_quota_ctl_args *sa; |
3578 | struct btrfs_trans_handle *trans = NULL; | 3578 | struct btrfs_trans_handle *trans = NULL; |
3579 | int ret; | 3579 | int ret; |
@@ -3632,7 +3632,7 @@ drop_write: | |||
3632 | 3632 | ||
3633 | static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg) | 3633 | static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg) |
3634 | { | 3634 | { |
3635 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 3635 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
3636 | struct btrfs_ioctl_qgroup_assign_args *sa; | 3636 | struct btrfs_ioctl_qgroup_assign_args *sa; |
3637 | struct btrfs_trans_handle *trans; | 3637 | struct btrfs_trans_handle *trans; |
3638 | int ret; | 3638 | int ret; |
@@ -3679,7 +3679,7 @@ drop_write: | |||
3679 | 3679 | ||
3680 | static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg) | 3680 | static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg) |
3681 | { | 3681 | { |
3682 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 3682 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
3683 | struct btrfs_ioctl_qgroup_create_args *sa; | 3683 | struct btrfs_ioctl_qgroup_create_args *sa; |
3684 | struct btrfs_trans_handle *trans; | 3684 | struct btrfs_trans_handle *trans; |
3685 | int ret; | 3685 | int ret; |
@@ -3725,7 +3725,7 @@ drop_write: | |||
3725 | 3725 | ||
3726 | static long btrfs_ioctl_qgroup_limit(struct file *file, void __user *arg) | 3726 | static long btrfs_ioctl_qgroup_limit(struct file *file, void __user *arg) |
3727 | { | 3727 | { |
3728 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 3728 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
3729 | struct btrfs_ioctl_qgroup_limit_args *sa; | 3729 | struct btrfs_ioctl_qgroup_limit_args *sa; |
3730 | struct btrfs_trans_handle *trans; | 3730 | struct btrfs_trans_handle *trans; |
3731 | int ret; | 3731 | int ret; |
@@ -3775,7 +3775,7 @@ static long btrfs_ioctl_set_received_subvol(struct file *file, | |||
3775 | void __user *arg) | 3775 | void __user *arg) |
3776 | { | 3776 | { |
3777 | struct btrfs_ioctl_received_subvol_args *sa = NULL; | 3777 | struct btrfs_ioctl_received_subvol_args *sa = NULL; |
3778 | struct inode *inode = fdentry(file)->d_inode; | 3778 | struct inode *inode = file_inode(file); |
3779 | struct btrfs_root *root = BTRFS_I(inode)->root; | 3779 | struct btrfs_root *root = BTRFS_I(inode)->root; |
3780 | struct btrfs_root_item *root_item = &root->root_item; | 3780 | struct btrfs_root_item *root_item = &root->root_item; |
3781 | struct btrfs_trans_handle *trans; | 3781 | struct btrfs_trans_handle *trans; |
@@ -3855,7 +3855,7 @@ out: | |||
3855 | long btrfs_ioctl(struct file *file, unsigned int | 3855 | long btrfs_ioctl(struct file *file, unsigned int |
3856 | cmd, unsigned long arg) | 3856 | cmd, unsigned long arg) |
3857 | { | 3857 | { |
3858 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 3858 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
3859 | void __user *argp = (void __user *)arg; | 3859 | void __user *argp = (void __user *)arg; |
3860 | 3860 | ||
3861 | switch (cmd) { | 3861 | switch (cmd) { |
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 54454542ad40..f80df6b04648 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c | |||
@@ -4542,7 +4542,7 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_) | |||
4542 | if (!capable(CAP_SYS_ADMIN)) | 4542 | if (!capable(CAP_SYS_ADMIN)) |
4543 | return -EPERM; | 4543 | return -EPERM; |
4544 | 4544 | ||
4545 | send_root = BTRFS_I(fdentry(mnt_file)->d_inode)->root; | 4545 | send_root = BTRFS_I(file_inode(mnt_file))->root; |
4546 | fs_info = send_root->fs_info; | 4546 | fs_info = send_root->fs_info; |
4547 | 4547 | ||
4548 | arg = memdup_user(arg_, sizeof(*arg)); | 4548 | arg = memdup_user(arg_, sizeof(*arg)); |
diff --git a/fs/buffer.c b/fs/buffer.c index 7a75c3e0fd58..b8a8b4d64d8c 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -2332,7 +2332,7 @@ int __block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, | |||
2332 | get_block_t get_block) | 2332 | get_block_t get_block) |
2333 | { | 2333 | { |
2334 | struct page *page = vmf->page; | 2334 | struct page *page = vmf->page; |
2335 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; | 2335 | struct inode *inode = file_inode(vma->vm_file); |
2336 | unsigned long end; | 2336 | unsigned long end; |
2337 | loff_t size; | 2337 | loff_t size; |
2338 | int ret; | 2338 | int ret; |
@@ -2371,7 +2371,7 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, | |||
2371 | get_block_t get_block) | 2371 | get_block_t get_block) |
2372 | { | 2372 | { |
2373 | int ret; | 2373 | int ret; |
2374 | struct super_block *sb = vma->vm_file->f_path.dentry->d_inode->i_sb; | 2374 | struct super_block *sb = file_inode(vma->vm_file)->i_sb; |
2375 | 2375 | ||
2376 | sb_start_pagefault(sb); | 2376 | sb_start_pagefault(sb); |
2377 | 2377 | ||
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 064d1a68d2c1..d4f81edd9a5d 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
@@ -195,7 +195,7 @@ static int ceph_releasepage(struct page *page, gfp_t g) | |||
195 | */ | 195 | */ |
196 | static int readpage_nounlock(struct file *filp, struct page *page) | 196 | static int readpage_nounlock(struct file *filp, struct page *page) |
197 | { | 197 | { |
198 | struct inode *inode = filp->f_dentry->d_inode; | 198 | struct inode *inode = file_inode(filp); |
199 | struct ceph_inode_info *ci = ceph_inode(inode); | 199 | struct ceph_inode_info *ci = ceph_inode(inode); |
200 | struct ceph_osd_client *osdc = | 200 | struct ceph_osd_client *osdc = |
201 | &ceph_inode_to_client(inode)->client->osdc; | 201 | &ceph_inode_to_client(inode)->client->osdc; |
@@ -370,7 +370,7 @@ out: | |||
370 | static int ceph_readpages(struct file *file, struct address_space *mapping, | 370 | static int ceph_readpages(struct file *file, struct address_space *mapping, |
371 | struct list_head *page_list, unsigned nr_pages) | 371 | struct list_head *page_list, unsigned nr_pages) |
372 | { | 372 | { |
373 | struct inode *inode = file->f_dentry->d_inode; | 373 | struct inode *inode = file_inode(file); |
374 | struct ceph_fs_client *fsc = ceph_inode_to_client(inode); | 374 | struct ceph_fs_client *fsc = ceph_inode_to_client(inode); |
375 | int rc = 0; | 375 | int rc = 0; |
376 | int max = 0; | 376 | int max = 0; |
@@ -977,7 +977,7 @@ static int ceph_update_writeable_page(struct file *file, | |||
977 | loff_t pos, unsigned len, | 977 | loff_t pos, unsigned len, |
978 | struct page *page) | 978 | struct page *page) |
979 | { | 979 | { |
980 | struct inode *inode = file->f_dentry->d_inode; | 980 | struct inode *inode = file_inode(file); |
981 | struct ceph_inode_info *ci = ceph_inode(inode); | 981 | struct ceph_inode_info *ci = ceph_inode(inode); |
982 | struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; | 982 | struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; |
983 | loff_t page_off = pos & PAGE_CACHE_MASK; | 983 | loff_t page_off = pos & PAGE_CACHE_MASK; |
@@ -1086,7 +1086,7 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping, | |||
1086 | loff_t pos, unsigned len, unsigned flags, | 1086 | loff_t pos, unsigned len, unsigned flags, |
1087 | struct page **pagep, void **fsdata) | 1087 | struct page **pagep, void **fsdata) |
1088 | { | 1088 | { |
1089 | struct inode *inode = file->f_dentry->d_inode; | 1089 | struct inode *inode = file_inode(file); |
1090 | struct ceph_inode_info *ci = ceph_inode(inode); | 1090 | struct ceph_inode_info *ci = ceph_inode(inode); |
1091 | struct ceph_file_info *fi = file->private_data; | 1091 | struct ceph_file_info *fi = file->private_data; |
1092 | struct page *page; | 1092 | struct page *page; |
@@ -1144,7 +1144,7 @@ static int ceph_write_end(struct file *file, struct address_space *mapping, | |||
1144 | loff_t pos, unsigned len, unsigned copied, | 1144 | loff_t pos, unsigned len, unsigned copied, |
1145 | struct page *page, void *fsdata) | 1145 | struct page *page, void *fsdata) |
1146 | { | 1146 | { |
1147 | struct inode *inode = file->f_dentry->d_inode; | 1147 | struct inode *inode = file_inode(file); |
1148 | struct ceph_inode_info *ci = ceph_inode(inode); | 1148 | struct ceph_inode_info *ci = ceph_inode(inode); |
1149 | struct ceph_fs_client *fsc = ceph_inode_to_client(inode); | 1149 | struct ceph_fs_client *fsc = ceph_inode_to_client(inode); |
1150 | struct ceph_mds_client *mdsc = fsc->mdsc; | 1150 | struct ceph_mds_client *mdsc = fsc->mdsc; |
@@ -1228,7 +1228,7 @@ const struct address_space_operations ceph_aops = { | |||
1228 | */ | 1228 | */ |
1229 | static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | 1229 | static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) |
1230 | { | 1230 | { |
1231 | struct inode *inode = vma->vm_file->f_dentry->d_inode; | 1231 | struct inode *inode = file_inode(vma->vm_file); |
1232 | struct page *page = vmf->page; | 1232 | struct page *page = vmf->page; |
1233 | struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; | 1233 | struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; |
1234 | loff_t off = page_offset(page); | 1234 | loff_t off = page_offset(page); |
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 8c1aabe93b67..6d797f46d772 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -238,7 +238,7 @@ static int note_last_dentry(struct ceph_file_info *fi, const char *name, | |||
238 | static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir) | 238 | static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir) |
239 | { | 239 | { |
240 | struct ceph_file_info *fi = filp->private_data; | 240 | struct ceph_file_info *fi = filp->private_data; |
241 | struct inode *inode = filp->f_dentry->d_inode; | 241 | struct inode *inode = file_inode(filp); |
242 | struct ceph_inode_info *ci = ceph_inode(inode); | 242 | struct ceph_inode_info *ci = ceph_inode(inode); |
243 | struct ceph_fs_client *fsc = ceph_inode_to_client(inode); | 243 | struct ceph_fs_client *fsc = ceph_inode_to_client(inode); |
244 | struct ceph_mds_client *mdsc = fsc->mdsc; | 244 | struct ceph_mds_client *mdsc = fsc->mdsc; |
@@ -1138,7 +1138,7 @@ static ssize_t ceph_read_dir(struct file *file, char __user *buf, size_t size, | |||
1138 | loff_t *ppos) | 1138 | loff_t *ppos) |
1139 | { | 1139 | { |
1140 | struct ceph_file_info *cf = file->private_data; | 1140 | struct ceph_file_info *cf = file->private_data; |
1141 | struct inode *inode = file->f_dentry->d_inode; | 1141 | struct inode *inode = file_inode(file); |
1142 | struct ceph_inode_info *ci = ceph_inode(inode); | 1142 | struct ceph_inode_info *ci = ceph_inode(inode); |
1143 | int left; | 1143 | int left; |
1144 | const int bufsize = 1024; | 1144 | const int bufsize = 1024; |
@@ -1188,7 +1188,7 @@ static ssize_t ceph_read_dir(struct file *file, char __user *buf, size_t size, | |||
1188 | static int ceph_dir_fsync(struct file *file, loff_t start, loff_t end, | 1188 | static int ceph_dir_fsync(struct file *file, loff_t start, loff_t end, |
1189 | int datasync) | 1189 | int datasync) |
1190 | { | 1190 | { |
1191 | struct inode *inode = file->f_path.dentry->d_inode; | 1191 | struct inode *inode = file_inode(file); |
1192 | struct ceph_inode_info *ci = ceph_inode(inode); | 1192 | struct ceph_inode_info *ci = ceph_inode(inode); |
1193 | struct list_head *head = &ci->i_unsafe_dirops; | 1193 | struct list_head *head = &ci->i_unsafe_dirops; |
1194 | struct ceph_mds_request *req; | 1194 | struct ceph_mds_request *req; |
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index e51558fca3a3..11b57c2c8f15 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -393,7 +393,7 @@ more: | |||
393 | static ssize_t ceph_sync_read(struct file *file, char __user *data, | 393 | static ssize_t ceph_sync_read(struct file *file, char __user *data, |
394 | unsigned len, loff_t *poff, int *checkeof) | 394 | unsigned len, loff_t *poff, int *checkeof) |
395 | { | 395 | { |
396 | struct inode *inode = file->f_dentry->d_inode; | 396 | struct inode *inode = file_inode(file); |
397 | struct page **pages; | 397 | struct page **pages; |
398 | u64 off = *poff; | 398 | u64 off = *poff; |
399 | int num_pages, ret; | 399 | int num_pages, ret; |
@@ -466,7 +466,7 @@ static void sync_write_commit(struct ceph_osd_request *req, | |||
466 | static ssize_t ceph_sync_write(struct file *file, const char __user *data, | 466 | static ssize_t ceph_sync_write(struct file *file, const char __user *data, |
467 | size_t left, loff_t *offset) | 467 | size_t left, loff_t *offset) |
468 | { | 468 | { |
469 | struct inode *inode = file->f_dentry->d_inode; | 469 | struct inode *inode = file_inode(file); |
470 | struct ceph_inode_info *ci = ceph_inode(inode); | 470 | struct ceph_inode_info *ci = ceph_inode(inode); |
471 | struct ceph_fs_client *fsc = ceph_inode_to_client(inode); | 471 | struct ceph_fs_client *fsc = ceph_inode_to_client(inode); |
472 | struct ceph_osd_request *req; | 472 | struct ceph_osd_request *req; |
@@ -483,7 +483,7 @@ static ssize_t ceph_sync_write(struct file *file, const char __user *data, | |||
483 | int ret; | 483 | int ret; |
484 | struct timespec mtime = CURRENT_TIME; | 484 | struct timespec mtime = CURRENT_TIME; |
485 | 485 | ||
486 | if (ceph_snap(file->f_dentry->d_inode) != CEPH_NOSNAP) | 486 | if (ceph_snap(file_inode(file)) != CEPH_NOSNAP) |
487 | return -EROFS; | 487 | return -EROFS; |
488 | 488 | ||
489 | dout("sync_write on file %p %lld~%u %s\n", file, *offset, | 489 | dout("sync_write on file %p %lld~%u %s\n", file, *offset, |
@@ -637,7 +637,7 @@ static ssize_t ceph_aio_read(struct kiocb *iocb, const struct iovec *iov, | |||
637 | struct ceph_file_info *fi = filp->private_data; | 637 | struct ceph_file_info *fi = filp->private_data; |
638 | loff_t *ppos = &iocb->ki_pos; | 638 | loff_t *ppos = &iocb->ki_pos; |
639 | size_t len = iov->iov_len; | 639 | size_t len = iov->iov_len; |
640 | struct inode *inode = filp->f_dentry->d_inode; | 640 | struct inode *inode = file_inode(filp); |
641 | struct ceph_inode_info *ci = ceph_inode(inode); | 641 | struct ceph_inode_info *ci = ceph_inode(inode); |
642 | void __user *base = iov->iov_base; | 642 | void __user *base = iov->iov_base; |
643 | ssize_t ret; | 643 | ssize_t ret; |
@@ -707,7 +707,7 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
707 | { | 707 | { |
708 | struct file *file = iocb->ki_filp; | 708 | struct file *file = iocb->ki_filp; |
709 | struct ceph_file_info *fi = file->private_data; | 709 | struct ceph_file_info *fi = file->private_data; |
710 | struct inode *inode = file->f_dentry->d_inode; | 710 | struct inode *inode = file_inode(file); |
711 | struct ceph_inode_info *ci = ceph_inode(inode); | 711 | struct ceph_inode_info *ci = ceph_inode(inode); |
712 | struct ceph_osd_client *osdc = | 712 | struct ceph_osd_client *osdc = |
713 | &ceph_sb_to_client(inode->i_sb)->client->osdc; | 713 | &ceph_sb_to_client(inode->i_sb)->client->osdc; |
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index 36549a46e311..f5ed767806df 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c | |||
@@ -16,11 +16,11 @@ | |||
16 | */ | 16 | */ |
17 | static long ceph_ioctl_get_layout(struct file *file, void __user *arg) | 17 | static long ceph_ioctl_get_layout(struct file *file, void __user *arg) |
18 | { | 18 | { |
19 | struct ceph_inode_info *ci = ceph_inode(file->f_dentry->d_inode); | 19 | struct ceph_inode_info *ci = ceph_inode(file_inode(file)); |
20 | struct ceph_ioctl_layout l; | 20 | struct ceph_ioctl_layout l; |
21 | int err; | 21 | int err; |
22 | 22 | ||
23 | err = ceph_do_getattr(file->f_dentry->d_inode, CEPH_STAT_CAP_LAYOUT); | 23 | err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT); |
24 | if (!err) { | 24 | if (!err) { |
25 | l.stripe_unit = ceph_file_layout_su(ci->i_layout); | 25 | l.stripe_unit = ceph_file_layout_su(ci->i_layout); |
26 | l.stripe_count = ceph_file_layout_stripe_count(ci->i_layout); | 26 | l.stripe_count = ceph_file_layout_stripe_count(ci->i_layout); |
@@ -63,12 +63,12 @@ static long __validate_layout(struct ceph_mds_client *mdsc, | |||
63 | 63 | ||
64 | static long ceph_ioctl_set_layout(struct file *file, void __user *arg) | 64 | static long ceph_ioctl_set_layout(struct file *file, void __user *arg) |
65 | { | 65 | { |
66 | struct inode *inode = file->f_dentry->d_inode; | 66 | struct inode *inode = file_inode(file); |
67 | struct inode *parent_inode; | 67 | struct inode *parent_inode; |
68 | struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; | 68 | struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; |
69 | struct ceph_mds_request *req; | 69 | struct ceph_mds_request *req; |
70 | struct ceph_ioctl_layout l; | 70 | struct ceph_ioctl_layout l; |
71 | struct ceph_inode_info *ci = ceph_inode(file->f_dentry->d_inode); | 71 | struct ceph_inode_info *ci = ceph_inode(file_inode(file)); |
72 | struct ceph_ioctl_layout nl; | 72 | struct ceph_ioctl_layout nl; |
73 | int err; | 73 | int err; |
74 | 74 | ||
@@ -76,7 +76,7 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg) | |||
76 | return -EFAULT; | 76 | return -EFAULT; |
77 | 77 | ||
78 | /* validate changed params against current layout */ | 78 | /* validate changed params against current layout */ |
79 | err = ceph_do_getattr(file->f_dentry->d_inode, CEPH_STAT_CAP_LAYOUT); | 79 | err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT); |
80 | if (err) | 80 | if (err) |
81 | return err; | 81 | return err; |
82 | 82 | ||
@@ -136,7 +136,7 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg) | |||
136 | */ | 136 | */ |
137 | static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg) | 137 | static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg) |
138 | { | 138 | { |
139 | struct inode *inode = file->f_dentry->d_inode; | 139 | struct inode *inode = file_inode(file); |
140 | struct ceph_mds_request *req; | 140 | struct ceph_mds_request *req; |
141 | struct ceph_ioctl_layout l; | 141 | struct ceph_ioctl_layout l; |
142 | int err; | 142 | int err; |
@@ -179,7 +179,7 @@ static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg) | |||
179 | static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) | 179 | static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) |
180 | { | 180 | { |
181 | struct ceph_ioctl_dataloc dl; | 181 | struct ceph_ioctl_dataloc dl; |
182 | struct inode *inode = file->f_dentry->d_inode; | 182 | struct inode *inode = file_inode(file); |
183 | struct ceph_inode_info *ci = ceph_inode(inode); | 183 | struct ceph_inode_info *ci = ceph_inode(inode); |
184 | struct ceph_osd_client *osdc = | 184 | struct ceph_osd_client *osdc = |
185 | &ceph_sb_to_client(inode->i_sb)->client->osdc; | 185 | &ceph_sb_to_client(inode->i_sb)->client->osdc; |
@@ -234,7 +234,7 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) | |||
234 | static long ceph_ioctl_lazyio(struct file *file) | 234 | static long ceph_ioctl_lazyio(struct file *file) |
235 | { | 235 | { |
236 | struct ceph_file_info *fi = file->private_data; | 236 | struct ceph_file_info *fi = file->private_data; |
237 | struct inode *inode = file->f_dentry->d_inode; | 237 | struct inode *inode = file_inode(file); |
238 | struct ceph_inode_info *ci = ceph_inode(inode); | 238 | struct ceph_inode_info *ci = ceph_inode(inode); |
239 | 239 | ||
240 | if ((fi->fmode & CEPH_FILE_MODE_LAZY) == 0) { | 240 | if ((fi->fmode & CEPH_FILE_MODE_LAZY) == 0) { |
diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c index 80576d05d687..202dd3d68be0 100644 --- a/fs/ceph/locks.c +++ b/fs/ceph/locks.c | |||
@@ -13,7 +13,7 @@ | |||
13 | static int ceph_lock_message(u8 lock_type, u16 operation, struct file *file, | 13 | static int ceph_lock_message(u8 lock_type, u16 operation, struct file *file, |
14 | int cmd, u8 wait, struct file_lock *fl) | 14 | int cmd, u8 wait, struct file_lock *fl) |
15 | { | 15 | { |
16 | struct inode *inode = file->f_dentry->d_inode; | 16 | struct inode *inode = file_inode(file); |
17 | struct ceph_mds_client *mdsc = | 17 | struct ceph_mds_client *mdsc = |
18 | ceph_sb_to_client(inode->i_sb)->mdsc; | 18 | ceph_sb_to_client(inode->i_sb)->mdsc; |
19 | struct ceph_mds_request *req; | 19 | struct ceph_mds_request *req; |
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index de7f9168a118..8b35365c70be 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -677,7 +677,7 @@ out_nls: | |||
677 | static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | 677 | static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov, |
678 | unsigned long nr_segs, loff_t pos) | 678 | unsigned long nr_segs, loff_t pos) |
679 | { | 679 | { |
680 | struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; | 680 | struct inode *inode = file_inode(iocb->ki_filp); |
681 | ssize_t written; | 681 | ssize_t written; |
682 | int rc; | 682 | int rc; |
683 | 683 | ||
@@ -701,7 +701,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int whence) | |||
701 | */ | 701 | */ |
702 | if (whence != SEEK_SET && whence != SEEK_CUR) { | 702 | if (whence != SEEK_SET && whence != SEEK_CUR) { |
703 | int rc; | 703 | int rc; |
704 | struct inode *inode = file->f_path.dentry->d_inode; | 704 | struct inode *inode = file_inode(file); |
705 | 705 | ||
706 | /* | 706 | /* |
707 | * We need to be sure that all dirty pages are written and the | 707 | * We need to be sure that all dirty pages are written and the |
@@ -733,7 +733,7 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease) | |||
733 | { | 733 | { |
734 | /* note that this is called by vfs setlease with lock_flocks held | 734 | /* note that this is called by vfs setlease with lock_flocks held |
735 | to protect *lease from going away */ | 735 | to protect *lease from going away */ |
736 | struct inode *inode = file->f_path.dentry->d_inode; | 736 | struct inode *inode = file_inode(file); |
737 | struct cifsFileInfo *cfile = file->private_data; | 737 | struct cifsFileInfo *cfile = file->private_data; |
738 | 738 | ||
739 | if (!(S_ISREG(inode->i_mode))) | 739 | if (!(S_ISREG(inode->i_mode))) |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 8ea6ca50a665..1a5c2911b043 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -947,7 +947,7 @@ static int | |||
947 | cifs_posix_lock_test(struct file *file, struct file_lock *flock) | 947 | cifs_posix_lock_test(struct file *file, struct file_lock *flock) |
948 | { | 948 | { |
949 | int rc = 0; | 949 | int rc = 0; |
950 | struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode); | 950 | struct cifsInodeInfo *cinode = CIFS_I(file_inode(file)); |
951 | unsigned char saved_type = flock->fl_type; | 951 | unsigned char saved_type = flock->fl_type; |
952 | 952 | ||
953 | if ((flock->fl_flags & FL_POSIX) == 0) | 953 | if ((flock->fl_flags & FL_POSIX) == 0) |
@@ -974,7 +974,7 @@ cifs_posix_lock_test(struct file *file, struct file_lock *flock) | |||
974 | static int | 974 | static int |
975 | cifs_posix_lock_set(struct file *file, struct file_lock *flock) | 975 | cifs_posix_lock_set(struct file *file, struct file_lock *flock) |
976 | { | 976 | { |
977 | struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode); | 977 | struct cifsInodeInfo *cinode = CIFS_I(file_inode(file)); |
978 | int rc = 1; | 978 | int rc = 1; |
979 | 979 | ||
980 | if ((flock->fl_flags & FL_POSIX) == 0) | 980 | if ((flock->fl_flags & FL_POSIX) == 0) |
@@ -1548,7 +1548,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock) | |||
1548 | 1548 | ||
1549 | cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 1549 | cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); |
1550 | netfid = cfile->fid.netfid; | 1550 | netfid = cfile->fid.netfid; |
1551 | cinode = CIFS_I(file->f_path.dentry->d_inode); | 1551 | cinode = CIFS_I(file_inode(file)); |
1552 | 1552 | ||
1553 | if (cap_unix(tcon->ses) && | 1553 | if (cap_unix(tcon->ses) && |
1554 | (CIFS_UNIX_FCNTL_CAP & le64_to_cpu(tcon->fsUnixInfo.Capability)) && | 1554 | (CIFS_UNIX_FCNTL_CAP & le64_to_cpu(tcon->fsUnixInfo.Capability)) && |
@@ -2171,7 +2171,7 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end, | |||
2171 | struct cifs_tcon *tcon; | 2171 | struct cifs_tcon *tcon; |
2172 | struct TCP_Server_Info *server; | 2172 | struct TCP_Server_Info *server; |
2173 | struct cifsFileInfo *smbfile = file->private_data; | 2173 | struct cifsFileInfo *smbfile = file->private_data; |
2174 | struct inode *inode = file->f_path.dentry->d_inode; | 2174 | struct inode *inode = file_inode(file); |
2175 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 2175 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
2176 | 2176 | ||
2177 | rc = filemap_write_and_wait_range(inode->i_mapping, start, end); | 2177 | rc = filemap_write_and_wait_range(inode->i_mapping, start, end); |
@@ -2246,7 +2246,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
2246 | */ | 2246 | */ |
2247 | int cifs_flush(struct file *file, fl_owner_t id) | 2247 | int cifs_flush(struct file *file, fl_owner_t id) |
2248 | { | 2248 | { |
2249 | struct inode *inode = file->f_path.dentry->d_inode; | 2249 | struct inode *inode = file_inode(file); |
2250 | int rc = 0; | 2250 | int rc = 0; |
2251 | 2251 | ||
2252 | if (file->f_mode & FMODE_WRITE) | 2252 | if (file->f_mode & FMODE_WRITE) |
@@ -2480,7 +2480,7 @@ ssize_t cifs_user_writev(struct kiocb *iocb, const struct iovec *iov, | |||
2480 | ssize_t written; | 2480 | ssize_t written; |
2481 | struct inode *inode; | 2481 | struct inode *inode; |
2482 | 2482 | ||
2483 | inode = iocb->ki_filp->f_path.dentry->d_inode; | 2483 | inode = file_inode(iocb->ki_filp); |
2484 | 2484 | ||
2485 | /* | 2485 | /* |
2486 | * BB - optimize the way when signing is disabled. We can drop this | 2486 | * BB - optimize the way when signing is disabled. We can drop this |
@@ -2543,7 +2543,7 @@ ssize_t | |||
2543 | cifs_strict_writev(struct kiocb *iocb, const struct iovec *iov, | 2543 | cifs_strict_writev(struct kiocb *iocb, const struct iovec *iov, |
2544 | unsigned long nr_segs, loff_t pos) | 2544 | unsigned long nr_segs, loff_t pos) |
2545 | { | 2545 | { |
2546 | struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; | 2546 | struct inode *inode = file_inode(iocb->ki_filp); |
2547 | struct cifsInodeInfo *cinode = CIFS_I(inode); | 2547 | struct cifsInodeInfo *cinode = CIFS_I(inode); |
2548 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 2548 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
2549 | struct cifsFileInfo *cfile = (struct cifsFileInfo *) | 2549 | struct cifsFileInfo *cfile = (struct cifsFileInfo *) |
@@ -2915,7 +2915,7 @@ ssize_t | |||
2915 | cifs_strict_readv(struct kiocb *iocb, const struct iovec *iov, | 2915 | cifs_strict_readv(struct kiocb *iocb, const struct iovec *iov, |
2916 | unsigned long nr_segs, loff_t pos) | 2916 | unsigned long nr_segs, loff_t pos) |
2917 | { | 2917 | { |
2918 | struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; | 2918 | struct inode *inode = file_inode(iocb->ki_filp); |
2919 | struct cifsInodeInfo *cinode = CIFS_I(inode); | 2919 | struct cifsInodeInfo *cinode = CIFS_I(inode); |
2920 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 2920 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
2921 | struct cifsFileInfo *cfile = (struct cifsFileInfo *) | 2921 | struct cifsFileInfo *cfile = (struct cifsFileInfo *) |
@@ -3063,7 +3063,7 @@ static struct vm_operations_struct cifs_file_vm_ops = { | |||
3063 | int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma) | 3063 | int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma) |
3064 | { | 3064 | { |
3065 | int rc, xid; | 3065 | int rc, xid; |
3066 | struct inode *inode = file->f_path.dentry->d_inode; | 3066 | struct inode *inode = file_inode(file); |
3067 | 3067 | ||
3068 | xid = get_xid(); | 3068 | xid = get_xid(); |
3069 | 3069 | ||
@@ -3356,7 +3356,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page, | |||
3356 | int rc; | 3356 | int rc; |
3357 | 3357 | ||
3358 | /* Is the page cached? */ | 3358 | /* Is the page cached? */ |
3359 | rc = cifs_readpage_from_fscache(file->f_path.dentry->d_inode, page); | 3359 | rc = cifs_readpage_from_fscache(file_inode(file), page); |
3360 | if (rc == 0) | 3360 | if (rc == 0) |
3361 | goto read_complete; | 3361 | goto read_complete; |
3362 | 3362 | ||
@@ -3371,8 +3371,8 @@ static int cifs_readpage_worker(struct file *file, struct page *page, | |||
3371 | else | 3371 | else |
3372 | cFYI(1, "Bytes read %d", rc); | 3372 | cFYI(1, "Bytes read %d", rc); |
3373 | 3373 | ||
3374 | file->f_path.dentry->d_inode->i_atime = | 3374 | file_inode(file)->i_atime = |
3375 | current_fs_time(file->f_path.dentry->d_inode->i_sb); | 3375 | current_fs_time(file_inode(file)->i_sb); |
3376 | 3376 | ||
3377 | if (PAGE_CACHE_SIZE > rc) | 3377 | if (PAGE_CACHE_SIZE > rc) |
3378 | memset(read_data + rc, 0, PAGE_CACHE_SIZE - rc); | 3378 | memset(read_data + rc, 0, PAGE_CACHE_SIZE - rc); |
@@ -3381,7 +3381,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page, | |||
3381 | SetPageUptodate(page); | 3381 | SetPageUptodate(page); |
3382 | 3382 | ||
3383 | /* send this page to the cache */ | 3383 | /* send this page to the cache */ |
3384 | cifs_readpage_to_fscache(file->f_path.dentry->d_inode, page); | 3384 | cifs_readpage_to_fscache(file_inode(file), page); |
3385 | 3385 | ||
3386 | rc = 0; | 3386 | rc = 0; |
3387 | 3387 | ||
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index ed6208ff85a7..1fc864b92cf2 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -289,7 +289,7 @@ cifs_get_file_info_unix(struct file *filp) | |||
289 | unsigned int xid; | 289 | unsigned int xid; |
290 | FILE_UNIX_BASIC_INFO find_data; | 290 | FILE_UNIX_BASIC_INFO find_data; |
291 | struct cifs_fattr fattr; | 291 | struct cifs_fattr fattr; |
292 | struct inode *inode = filp->f_path.dentry->d_inode; | 292 | struct inode *inode = file_inode(filp); |
293 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 293 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
294 | struct cifsFileInfo *cfile = filp->private_data; | 294 | struct cifsFileInfo *cfile = filp->private_data; |
295 | struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); | 295 | struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); |
@@ -558,7 +558,7 @@ cifs_get_file_info(struct file *filp) | |||
558 | unsigned int xid; | 558 | unsigned int xid; |
559 | FILE_ALL_INFO find_data; | 559 | FILE_ALL_INFO find_data; |
560 | struct cifs_fattr fattr; | 560 | struct cifs_fattr fattr; |
561 | struct inode *inode = filp->f_path.dentry->d_inode; | 561 | struct inode *inode = file_inode(filp); |
562 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 562 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
563 | struct cifsFileInfo *cfile = filp->private_data; | 563 | struct cifsFileInfo *cfile = filp->private_data; |
564 | struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); | 564 | struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); |
@@ -1678,7 +1678,7 @@ cifs_invalidate_mapping(struct inode *inode) | |||
1678 | int cifs_revalidate_file_attr(struct file *filp) | 1678 | int cifs_revalidate_file_attr(struct file *filp) |
1679 | { | 1679 | { |
1680 | int rc = 0; | 1680 | int rc = 0; |
1681 | struct inode *inode = filp->f_path.dentry->d_inode; | 1681 | struct inode *inode = file_inode(filp); |
1682 | struct cifsFileInfo *cfile = (struct cifsFileInfo *) filp->private_data; | 1682 | struct cifsFileInfo *cfile = (struct cifsFileInfo *) filp->private_data; |
1683 | 1683 | ||
1684 | if (!cifs_inode_needs_reval(inode)) | 1684 | if (!cifs_inode_needs_reval(inode)) |
@@ -1735,7 +1735,7 @@ out: | |||
1735 | int cifs_revalidate_file(struct file *filp) | 1735 | int cifs_revalidate_file(struct file *filp) |
1736 | { | 1736 | { |
1737 | int rc; | 1737 | int rc; |
1738 | struct inode *inode = filp->f_path.dentry->d_inode; | 1738 | struct inode *inode = file_inode(filp); |
1739 | 1739 | ||
1740 | rc = cifs_revalidate_file_attr(filp); | 1740 | rc = cifs_revalidate_file_attr(filp); |
1741 | if (rc) | 1741 | if (rc) |
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c index fd5009d56f9f..6c9f1214cf0b 100644 --- a/fs/cifs/ioctl.c +++ b/fs/cifs/ioctl.c | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) | 31 | long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) |
32 | { | 32 | { |
33 | struct inode *inode = filep->f_dentry->d_inode; | 33 | struct inode *inode = file_inode(filep); |
34 | int rc = -ENOTTY; /* strange error - but the precedent */ | 34 | int rc = -ENOTTY; /* strange error - but the precedent */ |
35 | unsigned int xid; | 35 | unsigned int xid; |
36 | struct cifs_sb_info *cifs_sb; | 36 | struct cifs_sb_info *cifs_sb; |
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index cdd6ff48246b..7255b0c7aa7e 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
@@ -505,7 +505,7 @@ static int cifs_entry_is_dot(struct cifs_dirent *de, bool is_unicode) | |||
505 | whether we can use the cached search results from the previous search */ | 505 | whether we can use the cached search results from the previous search */ |
506 | static int is_dir_changed(struct file *file) | 506 | static int is_dir_changed(struct file *file) |
507 | { | 507 | { |
508 | struct inode *inode = file->f_path.dentry->d_inode; | 508 | struct inode *inode = file_inode(file); |
509 | struct cifsInodeInfo *cifsInfo = CIFS_I(inode); | 509 | struct cifsInodeInfo *cifsInfo = CIFS_I(inode); |
510 | 510 | ||
511 | if (cifsInfo->time == 0) | 511 | if (cifsInfo->time == 0) |
@@ -778,7 +778,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) | |||
778 | switch ((int) file->f_pos) { | 778 | switch ((int) file->f_pos) { |
779 | case 0: | 779 | case 0: |
780 | if (filldir(direntry, ".", 1, file->f_pos, | 780 | if (filldir(direntry, ".", 1, file->f_pos, |
781 | file->f_path.dentry->d_inode->i_ino, DT_DIR) < 0) { | 781 | file_inode(file)->i_ino, DT_DIR) < 0) { |
782 | cERROR(1, "Filldir for current dir failed"); | 782 | cERROR(1, "Filldir for current dir failed"); |
783 | rc = -ENOMEM; | 783 | rc = -ENOMEM; |
784 | break; | 784 | break; |
diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 49fe52d25600..b7d3a05c062c 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c | |||
@@ -397,7 +397,7 @@ static int coda_readdir(struct file *coda_file, void *buf, filldir_t filldir) | |||
397 | * We can't use vfs_readdir because we have to keep the file | 397 | * We can't use vfs_readdir because we have to keep the file |
398 | * position in sync between the coda_file and the host_file. | 398 | * position in sync between the coda_file and the host_file. |
399 | * and as such we need grab the inode mutex. */ | 399 | * and as such we need grab the inode mutex. */ |
400 | struct inode *host_inode = host_file->f_path.dentry->d_inode; | 400 | struct inode *host_inode = file_inode(host_file); |
401 | 401 | ||
402 | mutex_lock(&host_inode->i_mutex); | 402 | mutex_lock(&host_inode->i_mutex); |
403 | host_file->f_pos = coda_file->f_pos; | 403 | host_file->f_pos = coda_file->f_pos; |
diff --git a/fs/coda/file.c b/fs/coda/file.c index 8edd404e6419..fa4c100bdc7d 100644 --- a/fs/coda/file.c +++ b/fs/coda/file.c | |||
@@ -66,7 +66,7 @@ coda_file_splice_read(struct file *coda_file, loff_t *ppos, | |||
66 | static ssize_t | 66 | static ssize_t |
67 | coda_file_write(struct file *coda_file, const char __user *buf, size_t count, loff_t *ppos) | 67 | coda_file_write(struct file *coda_file, const char __user *buf, size_t count, loff_t *ppos) |
68 | { | 68 | { |
69 | struct inode *host_inode, *coda_inode = coda_file->f_path.dentry->d_inode; | 69 | struct inode *host_inode, *coda_inode = file_inode(coda_file); |
70 | struct coda_file_info *cfi; | 70 | struct coda_file_info *cfi; |
71 | struct file *host_file; | 71 | struct file *host_file; |
72 | ssize_t ret; | 72 | ssize_t ret; |
@@ -78,7 +78,7 @@ coda_file_write(struct file *coda_file, const char __user *buf, size_t count, lo | |||
78 | if (!host_file->f_op || !host_file->f_op->write) | 78 | if (!host_file->f_op || !host_file->f_op->write) |
79 | return -EINVAL; | 79 | return -EINVAL; |
80 | 80 | ||
81 | host_inode = host_file->f_path.dentry->d_inode; | 81 | host_inode = file_inode(host_file); |
82 | mutex_lock(&coda_inode->i_mutex); | 82 | mutex_lock(&coda_inode->i_mutex); |
83 | 83 | ||
84 | ret = host_file->f_op->write(host_file, buf, count, ppos); | 84 | ret = host_file->f_op->write(host_file, buf, count, ppos); |
@@ -106,8 +106,8 @@ coda_file_mmap(struct file *coda_file, struct vm_area_struct *vma) | |||
106 | if (!host_file->f_op || !host_file->f_op->mmap) | 106 | if (!host_file->f_op || !host_file->f_op->mmap) |
107 | return -ENODEV; | 107 | return -ENODEV; |
108 | 108 | ||
109 | coda_inode = coda_file->f_path.dentry->d_inode; | 109 | coda_inode = file_inode(coda_file); |
110 | host_inode = host_file->f_path.dentry->d_inode; | 110 | host_inode = file_inode(host_file); |
111 | 111 | ||
112 | cii = ITOC(coda_inode); | 112 | cii = ITOC(coda_inode); |
113 | spin_lock(&cii->c_lock); | 113 | spin_lock(&cii->c_lock); |
@@ -178,7 +178,7 @@ int coda_release(struct inode *coda_inode, struct file *coda_file) | |||
178 | err = venus_close(coda_inode->i_sb, coda_i2f(coda_inode), | 178 | err = venus_close(coda_inode->i_sb, coda_i2f(coda_inode), |
179 | coda_flags, coda_file->f_cred->fsuid); | 179 | coda_flags, coda_file->f_cred->fsuid); |
180 | 180 | ||
181 | host_inode = cfi->cfi_container->f_path.dentry->d_inode; | 181 | host_inode = file_inode(cfi->cfi_container); |
182 | cii = ITOC(coda_inode); | 182 | cii = ITOC(coda_inode); |
183 | 183 | ||
184 | /* did we mmap this file? */ | 184 | /* did we mmap this file? */ |
@@ -202,7 +202,7 @@ int coda_release(struct inode *coda_inode, struct file *coda_file) | |||
202 | int coda_fsync(struct file *coda_file, loff_t start, loff_t end, int datasync) | 202 | int coda_fsync(struct file *coda_file, loff_t start, loff_t end, int datasync) |
203 | { | 203 | { |
204 | struct file *host_file; | 204 | struct file *host_file; |
205 | struct inode *coda_inode = coda_file->f_path.dentry->d_inode; | 205 | struct inode *coda_inode = file_inode(coda_file); |
206 | struct coda_file_info *cfi; | 206 | struct coda_file_info *cfi; |
207 | int err; | 207 | int err; |
208 | 208 | ||
diff --git a/fs/coda/inode.c b/fs/coda/inode.c index be2aa4909487..6df708c7b3e8 100644 --- a/fs/coda/inode.c +++ b/fs/coda/inode.c | |||
@@ -129,7 +129,7 @@ static int get_device_index(struct coda_mount_data *data) | |||
129 | f = fdget(data->fd); | 129 | f = fdget(data->fd); |
130 | if (!f.file) | 130 | if (!f.file) |
131 | goto Ebadf; | 131 | goto Ebadf; |
132 | inode = f.file->f_path.dentry->d_inode; | 132 | inode = file_inode(f.file); |
133 | if (!S_ISCHR(inode->i_mode) || imajor(inode) != CODA_PSDEV_MAJOR) { | 133 | if (!S_ISCHR(inode->i_mode) || imajor(inode) != CODA_PSDEV_MAJOR) { |
134 | fdput(f); | 134 | fdput(f); |
135 | goto Ebadf; | 135 | goto Ebadf; |
diff --git a/fs/coda/pioctl.c b/fs/coda/pioctl.c index ee0981f1375b..3f5de96bbb58 100644 --- a/fs/coda/pioctl.c +++ b/fs/coda/pioctl.c | |||
@@ -52,7 +52,7 @@ static long coda_pioctl(struct file *filp, unsigned int cmd, | |||
52 | struct path path; | 52 | struct path path; |
53 | int error; | 53 | int error; |
54 | struct PioctlData data; | 54 | struct PioctlData data; |
55 | struct inode *inode = filp->f_dentry->d_inode; | 55 | struct inode *inode = file_inode(filp); |
56 | struct inode *target_inode = NULL; | 56 | struct inode *target_inode = NULL; |
57 | struct coda_inode_info *cnp; | 57 | struct coda_inode_info *cnp; |
58 | 58 | ||
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index e2f57a007029..3ced75f765ca 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
@@ -1582,7 +1582,7 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, | |||
1582 | case FIBMAP: | 1582 | case FIBMAP: |
1583 | case FIGETBSZ: | 1583 | case FIGETBSZ: |
1584 | case FIONREAD: | 1584 | case FIONREAD: |
1585 | if (S_ISREG(f.file->f_path.dentry->d_inode->i_mode)) | 1585 | if (S_ISREG(file_inode(f.file)->i_mode)) |
1586 | break; | 1586 | break; |
1587 | /*FALL THROUGH*/ | 1587 | /*FALL THROUGH*/ |
1588 | 1588 | ||
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 712b10f64c70..90d222f11e36 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c | |||
@@ -1625,7 +1625,7 @@ static loff_t configfs_dir_lseek(struct file *file, loff_t offset, int whence) | |||
1625 | if (offset >= 0) | 1625 | if (offset >= 0) |
1626 | break; | 1626 | break; |
1627 | default: | 1627 | default: |
1628 | mutex_unlock(&file->f_path.dentry->d_inode->i_mutex); | 1628 | mutex_unlock(&file_inode(file)->i_mutex); |
1629 | return -EINVAL; | 1629 | return -EINVAL; |
1630 | } | 1630 | } |
1631 | if (offset != file->f_pos) { | 1631 | if (offset != file->f_pos) { |
diff --git a/fs/coredump.c b/fs/coredump.c index 177493272a61..69baf903d3bd 100644 --- a/fs/coredump.c +++ b/fs/coredump.c | |||
@@ -411,7 +411,7 @@ static void wait_for_dump_helpers(struct file *file) | |||
411 | { | 411 | { |
412 | struct pipe_inode_info *pipe; | 412 | struct pipe_inode_info *pipe; |
413 | 413 | ||
414 | pipe = file->f_path.dentry->d_inode->i_pipe; | 414 | pipe = file_inode(file)->i_pipe; |
415 | 415 | ||
416 | pipe_lock(pipe); | 416 | pipe_lock(pipe); |
417 | pipe->readers++; | 417 | pipe->readers++; |
@@ -600,7 +600,7 @@ void do_coredump(siginfo_t *siginfo) | |||
600 | if (IS_ERR(cprm.file)) | 600 | if (IS_ERR(cprm.file)) |
601 | goto fail_unlock; | 601 | goto fail_unlock; |
602 | 602 | ||
603 | inode = cprm.file->f_path.dentry->d_inode; | 603 | inode = file_inode(cprm.file); |
604 | if (inode->i_nlink > 1) | 604 | if (inode->i_nlink > 1) |
605 | goto close_fail; | 605 | goto close_fail; |
606 | if (d_unhashed(cprm.file->f_path.dentry)) | 606 | if (d_unhashed(cprm.file->f_path.dentry)) |
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index c6c3f91ecf06..3ceb9ec976e1 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c | |||
@@ -351,7 +351,7 @@ static int cramfs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
351 | */ | 351 | */ |
352 | static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | 352 | static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir) |
353 | { | 353 | { |
354 | struct inode *inode = filp->f_path.dentry->d_inode; | 354 | struct inode *inode = file_inode(filp); |
355 | struct super_block *sb = inode->i_sb; | 355 | struct super_block *sb = inode->i_sb; |
356 | char *buf; | 356 | char *buf; |
357 | unsigned int offset; | 357 | unsigned int offset; |
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index d45ba4568128..53acc9d0c138 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c | |||
@@ -118,7 +118,7 @@ static int ecryptfs_readdir(struct file *file, void *dirent, filldir_t filldir) | |||
118 | 118 | ||
119 | lower_file = ecryptfs_file_to_lower(file); | 119 | lower_file = ecryptfs_file_to_lower(file); |
120 | lower_file->f_pos = file->f_pos; | 120 | lower_file->f_pos = file->f_pos; |
121 | inode = file->f_path.dentry->d_inode; | 121 | inode = file_inode(file); |
122 | memset(&buf, 0, sizeof(buf)); | 122 | memset(&buf, 0, sizeof(buf)); |
123 | buf.dirent = dirent; | 123 | buf.dirent = dirent; |
124 | buf.dentry = file->f_path.dentry; | 124 | buf.dentry = file->f_path.dentry; |
@@ -133,7 +133,7 @@ static int ecryptfs_readdir(struct file *file, void *dirent, filldir_t filldir) | |||
133 | goto out; | 133 | goto out; |
134 | if (rc >= 0) | 134 | if (rc >= 0) |
135 | fsstack_copy_attr_atime(inode, | 135 | fsstack_copy_attr_atime(inode, |
136 | lower_file->f_path.dentry->d_inode); | 136 | file_inode(lower_file)); |
137 | out: | 137 | out: |
138 | return rc; | 138 | return rc; |
139 | } | 139 | } |
diff --git a/fs/efs/dir.c b/fs/efs/dir.c index 7ee6f7e3a608..055a9e9ca747 100644 --- a/fs/efs/dir.c +++ b/fs/efs/dir.c | |||
@@ -20,7 +20,7 @@ const struct inode_operations efs_dir_inode_operations = { | |||
20 | }; | 20 | }; |
21 | 21 | ||
22 | static int efs_readdir(struct file *filp, void *dirent, filldir_t filldir) { | 22 | static int efs_readdir(struct file *filp, void *dirent, filldir_t filldir) { |
23 | struct inode *inode = filp->f_path.dentry->d_inode; | 23 | struct inode *inode = file_inode(filp); |
24 | struct buffer_head *bh; | 24 | struct buffer_head *bh; |
25 | 25 | ||
26 | struct efs_dir *dirblock; | 26 | struct efs_dir *dirblock; |
@@ -123,7 +123,7 @@ SYSCALL_DEFINE1(uselib, const char __user *, library) | |||
123 | goto out; | 123 | goto out; |
124 | 124 | ||
125 | error = -EINVAL; | 125 | error = -EINVAL; |
126 | if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) | 126 | if (!S_ISREG(file_inode(file)->i_mode)) |
127 | goto exit; | 127 | goto exit; |
128 | 128 | ||
129 | error = -EACCES; | 129 | error = -EACCES; |
@@ -764,7 +764,7 @@ struct file *open_exec(const char *name) | |||
764 | goto out; | 764 | goto out; |
765 | 765 | ||
766 | err = -EACCES; | 766 | err = -EACCES; |
767 | if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) | 767 | if (!S_ISREG(file_inode(file)->i_mode)) |
768 | goto exit; | 768 | goto exit; |
769 | 769 | ||
770 | if (file->f_path.mnt->mnt_flags & MNT_NOEXEC) | 770 | if (file->f_path.mnt->mnt_flags & MNT_NOEXEC) |
@@ -1098,7 +1098,7 @@ EXPORT_SYMBOL(flush_old_exec); | |||
1098 | 1098 | ||
1099 | void would_dump(struct linux_binprm *bprm, struct file *file) | 1099 | void would_dump(struct linux_binprm *bprm, struct file *file) |
1100 | { | 1100 | { |
1101 | if (inode_permission(file->f_path.dentry->d_inode, MAY_READ) < 0) | 1101 | if (inode_permission(file_inode(file), MAY_READ) < 0) |
1102 | bprm->interp_flags |= BINPRM_FLAGS_ENFORCE_NONDUMP; | 1102 | bprm->interp_flags |= BINPRM_FLAGS_ENFORCE_NONDUMP; |
1103 | } | 1103 | } |
1104 | EXPORT_SYMBOL(would_dump); | 1104 | EXPORT_SYMBOL(would_dump); |
@@ -1270,7 +1270,7 @@ static int check_unsafe_exec(struct linux_binprm *bprm) | |||
1270 | int prepare_binprm(struct linux_binprm *bprm) | 1270 | int prepare_binprm(struct linux_binprm *bprm) |
1271 | { | 1271 | { |
1272 | umode_t mode; | 1272 | umode_t mode; |
1273 | struct inode * inode = bprm->file->f_path.dentry->d_inode; | 1273 | struct inode * inode = file_inode(bprm->file); |
1274 | int retval; | 1274 | int retval; |
1275 | 1275 | ||
1276 | mode = inode->i_mode; | 1276 | mode = inode->i_mode; |
diff --git a/fs/exofs/dir.c b/fs/exofs/dir.c index c61e62ac231c..46375896cfc0 100644 --- a/fs/exofs/dir.c +++ b/fs/exofs/dir.c | |||
@@ -242,7 +242,7 @@ static int | |||
242 | exofs_readdir(struct file *filp, void *dirent, filldir_t filldir) | 242 | exofs_readdir(struct file *filp, void *dirent, filldir_t filldir) |
243 | { | 243 | { |
244 | loff_t pos = filp->f_pos; | 244 | loff_t pos = filp->f_pos; |
245 | struct inode *inode = filp->f_path.dentry->d_inode; | 245 | struct inode *inode = file_inode(filp); |
246 | unsigned int offset = pos & ~PAGE_CACHE_MASK; | 246 | unsigned int offset = pos & ~PAGE_CACHE_MASK; |
247 | unsigned long n = pos >> PAGE_CACHE_SHIFT; | 247 | unsigned long n = pos >> PAGE_CACHE_SHIFT; |
248 | unsigned long npages = dir_pages(inode); | 248 | unsigned long npages = dir_pages(inode); |
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index 0f4f5c929257..4237722bfd27 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c | |||
@@ -290,7 +290,7 @@ static int | |||
290 | ext2_readdir (struct file * filp, void * dirent, filldir_t filldir) | 290 | ext2_readdir (struct file * filp, void * dirent, filldir_t filldir) |
291 | { | 291 | { |
292 | loff_t pos = filp->f_pos; | 292 | loff_t pos = filp->f_pos; |
293 | struct inode *inode = filp->f_path.dentry->d_inode; | 293 | struct inode *inode = file_inode(filp); |
294 | struct super_block *sb = inode->i_sb; | 294 | struct super_block *sb = inode->i_sb; |
295 | unsigned int offset = pos & ~PAGE_CACHE_MASK; | 295 | unsigned int offset = pos & ~PAGE_CACHE_MASK; |
296 | unsigned long n = pos >> PAGE_CACHE_SHIFT; | 296 | unsigned long n = pos >> PAGE_CACHE_SHIFT; |
diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c index 2de655f5d625..5d46c09863f0 100644 --- a/fs/ext2/ioctl.c +++ b/fs/ext2/ioctl.c | |||
@@ -19,7 +19,7 @@ | |||
19 | 19 | ||
20 | long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 20 | long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
21 | { | 21 | { |
22 | struct inode *inode = filp->f_dentry->d_inode; | 22 | struct inode *inode = file_inode(filp); |
23 | struct ext2_inode_info *ei = EXT2_I(inode); | 23 | struct ext2_inode_info *ei = EXT2_I(inode); |
24 | unsigned int flags; | 24 | unsigned int flags; |
25 | unsigned short rsv_window_size; | 25 | unsigned short rsv_window_size; |
diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c index dd91264ba94f..87eccbbca255 100644 --- a/fs/ext3/dir.c +++ b/fs/ext3/dir.c | |||
@@ -99,7 +99,7 @@ static int ext3_readdir(struct file * filp, | |||
99 | int i, stored; | 99 | int i, stored; |
100 | struct ext3_dir_entry_2 *de; | 100 | struct ext3_dir_entry_2 *de; |
101 | int err; | 101 | int err; |
102 | struct inode *inode = filp->f_path.dentry->d_inode; | 102 | struct inode *inode = file_inode(filp); |
103 | struct super_block *sb = inode->i_sb; | 103 | struct super_block *sb = inode->i_sb; |
104 | int ret = 0; | 104 | int ret = 0; |
105 | int dir_has_error = 0; | 105 | int dir_has_error = 0; |
@@ -114,7 +114,7 @@ static int ext3_readdir(struct file * filp, | |||
114 | * We don't set the inode dirty flag since it's not | 114 | * We don't set the inode dirty flag since it's not |
115 | * critical that it get flushed back to the disk. | 115 | * critical that it get flushed back to the disk. |
116 | */ | 116 | */ |
117 | EXT3_I(filp->f_path.dentry->d_inode)->i_flags &= ~EXT3_INDEX_FL; | 117 | EXT3_I(file_inode(filp))->i_flags &= ~EXT3_INDEX_FL; |
118 | } | 118 | } |
119 | stored = 0; | 119 | stored = 0; |
120 | offset = filp->f_pos & (sb->s_blocksize - 1); | 120 | offset = filp->f_pos & (sb->s_blocksize - 1); |
@@ -457,7 +457,7 @@ static int call_filldir(struct file * filp, void * dirent, | |||
457 | { | 457 | { |
458 | struct dir_private_info *info = filp->private_data; | 458 | struct dir_private_info *info = filp->private_data; |
459 | loff_t curr_pos; | 459 | loff_t curr_pos; |
460 | struct inode *inode = filp->f_path.dentry->d_inode; | 460 | struct inode *inode = file_inode(filp); |
461 | struct super_block * sb; | 461 | struct super_block * sb; |
462 | int error; | 462 | int error; |
463 | 463 | ||
@@ -487,7 +487,7 @@ static int ext3_dx_readdir(struct file * filp, | |||
487 | void * dirent, filldir_t filldir) | 487 | void * dirent, filldir_t filldir) |
488 | { | 488 | { |
489 | struct dir_private_info *info = filp->private_data; | 489 | struct dir_private_info *info = filp->private_data; |
490 | struct inode *inode = filp->f_path.dentry->d_inode; | 490 | struct inode *inode = file_inode(filp); |
491 | struct fname *fname; | 491 | struct fname *fname; |
492 | int ret; | 492 | int ret; |
493 | 493 | ||
diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c index 677a5c27dc69..4d96e9a64532 100644 --- a/fs/ext3/ioctl.c +++ b/fs/ext3/ioctl.c | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | long ext3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 15 | long ext3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
16 | { | 16 | { |
17 | struct inode *inode = filp->f_dentry->d_inode; | 17 | struct inode *inode = file_inode(filp); |
18 | struct ext3_inode_info *ei = EXT3_I(inode); | 18 | struct ext3_inode_info *ei = EXT3_I(inode); |
19 | unsigned int flags; | 19 | unsigned int flags; |
20 | unsigned short rsv_window_size; | 20 | unsigned short rsv_window_size; |
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index 890b8947c546..61fa09eb2501 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
@@ -624,7 +624,7 @@ int ext3_htree_fill_tree(struct file *dir_file, __u32 start_hash, | |||
624 | 624 | ||
625 | dxtrace(printk("In htree_fill_tree, start hash: %x:%x\n", start_hash, | 625 | dxtrace(printk("In htree_fill_tree, start hash: %x:%x\n", start_hash, |
626 | start_minor_hash)); | 626 | start_minor_hash)); |
627 | dir = dir_file->f_path.dentry->d_inode; | 627 | dir = file_inode(dir_file); |
628 | if (!(EXT3_I(dir)->i_flags & EXT3_INDEX_FL)) { | 628 | if (!(EXT3_I(dir)->i_flags & EXT3_INDEX_FL)) { |
629 | hinfo.hash_version = EXT3_SB(dir->i_sb)->s_def_hash_version; | 629 | hinfo.hash_version = EXT3_SB(dir->i_sb)->s_def_hash_version; |
630 | if (hinfo.hash_version <= DX_HASH_TEA) | 630 | if (hinfo.hash_version <= DX_HASH_TEA) |
@@ -638,7 +638,7 @@ int ext3_htree_fill_tree(struct file *dir_file, __u32 start_hash, | |||
638 | } | 638 | } |
639 | hinfo.hash = start_hash; | 639 | hinfo.hash = start_hash; |
640 | hinfo.minor_hash = 0; | 640 | hinfo.minor_hash = 0; |
641 | frame = dx_probe(NULL, dir_file->f_path.dentry->d_inode, &hinfo, frames, &err); | 641 | frame = dx_probe(NULL, file_inode(dir_file), &hinfo, frames, &err); |
642 | if (!frame) | 642 | if (!frame) |
643 | return err; | 643 | return err; |
644 | 644 | ||
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index 80a28b297279..dc149d123de5 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c | |||
@@ -110,7 +110,7 @@ static int ext4_readdir(struct file *filp, | |||
110 | int i, stored; | 110 | int i, stored; |
111 | struct ext4_dir_entry_2 *de; | 111 | struct ext4_dir_entry_2 *de; |
112 | int err; | 112 | int err; |
113 | struct inode *inode = filp->f_path.dentry->d_inode; | 113 | struct inode *inode = file_inode(filp); |
114 | struct super_block *sb = inode->i_sb; | 114 | struct super_block *sb = inode->i_sb; |
115 | int ret = 0; | 115 | int ret = 0; |
116 | int dir_has_error = 0; | 116 | int dir_has_error = 0; |
@@ -133,7 +133,7 @@ static int ext4_readdir(struct file *filp, | |||
133 | * We don't set the inode dirty flag since it's not | 133 | * We don't set the inode dirty flag since it's not |
134 | * critical that it get flushed back to the disk. | 134 | * critical that it get flushed back to the disk. |
135 | */ | 135 | */ |
136 | ext4_clear_inode_flag(filp->f_path.dentry->d_inode, | 136 | ext4_clear_inode_flag(file_inode(filp), |
137 | EXT4_INODE_INDEX); | 137 | EXT4_INODE_INDEX); |
138 | } | 138 | } |
139 | stored = 0; | 139 | stored = 0; |
@@ -494,7 +494,7 @@ static int call_filldir(struct file *filp, void *dirent, | |||
494 | { | 494 | { |
495 | struct dir_private_info *info = filp->private_data; | 495 | struct dir_private_info *info = filp->private_data; |
496 | loff_t curr_pos; | 496 | loff_t curr_pos; |
497 | struct inode *inode = filp->f_path.dentry->d_inode; | 497 | struct inode *inode = file_inode(filp); |
498 | struct super_block *sb; | 498 | struct super_block *sb; |
499 | int error; | 499 | int error; |
500 | 500 | ||
@@ -526,7 +526,7 @@ static int ext4_dx_readdir(struct file *filp, | |||
526 | void *dirent, filldir_t filldir) | 526 | void *dirent, filldir_t filldir) |
527 | { | 527 | { |
528 | struct dir_private_info *info = filp->private_data; | 528 | struct dir_private_info *info = filp->private_data; |
529 | struct inode *inode = filp->f_path.dentry->d_inode; | 529 | struct inode *inode = file_inode(filp); |
530 | struct fname *fname; | 530 | struct fname *fname; |
531 | int ret; | 531 | int ret; |
532 | 532 | ||
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 5ae1674ec12f..7817ca7c2bbf 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -4386,7 +4386,7 @@ static void ext4_falloc_update_inode(struct inode *inode, | |||
4386 | */ | 4386 | */ |
4387 | long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len) | 4387 | long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len) |
4388 | { | 4388 | { |
4389 | struct inode *inode = file->f_path.dentry->d_inode; | 4389 | struct inode *inode = file_inode(file); |
4390 | handle_t *handle; | 4390 | handle_t *handle; |
4391 | loff_t new_size; | 4391 | loff_t new_size; |
4392 | unsigned int max_blocks; | 4392 | unsigned int max_blocks; |
@@ -4643,7 +4643,7 @@ static int ext4_xattr_fiemap(struct inode *inode, | |||
4643 | */ | 4643 | */ |
4644 | int ext4_ext_punch_hole(struct file *file, loff_t offset, loff_t length) | 4644 | int ext4_ext_punch_hole(struct file *file, loff_t offset, loff_t length) |
4645 | { | 4645 | { |
4646 | struct inode *inode = file->f_path.dentry->d_inode; | 4646 | struct inode *inode = file_inode(file); |
4647 | struct super_block *sb = inode->i_sb; | 4647 | struct super_block *sb = inode->i_sb; |
4648 | ext4_lblk_t first_block, stop_block; | 4648 | ext4_lblk_t first_block, stop_block; |
4649 | struct address_space *mapping = inode->i_mapping; | 4649 | struct address_space *mapping = inode->i_mapping; |
diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 405565a62277..c00ea7945eb5 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c | |||
@@ -167,7 +167,7 @@ static ssize_t | |||
167 | ext4_file_write(struct kiocb *iocb, const struct iovec *iov, | 167 | ext4_file_write(struct kiocb *iocb, const struct iovec *iov, |
168 | unsigned long nr_segs, loff_t pos) | 168 | unsigned long nr_segs, loff_t pos) |
169 | { | 169 | { |
170 | struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; | 170 | struct inode *inode = file_inode(iocb->ki_filp); |
171 | ssize_t ret; | 171 | ssize_t ret; |
172 | 172 | ||
173 | /* | 173 | /* |
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 387c47c6cda9..8106dca95456 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c | |||
@@ -1298,7 +1298,7 @@ int ext4_read_inline_dir(struct file *filp, | |||
1298 | int i, stored; | 1298 | int i, stored; |
1299 | struct ext4_dir_entry_2 *de; | 1299 | struct ext4_dir_entry_2 *de; |
1300 | struct super_block *sb; | 1300 | struct super_block *sb; |
1301 | struct inode *inode = filp->f_path.dentry->d_inode; | 1301 | struct inode *inode = file_inode(filp); |
1302 | int ret, inline_size = 0; | 1302 | int ret, inline_size = 0; |
1303 | struct ext4_iloc iloc; | 1303 | struct ext4_iloc iloc; |
1304 | void *dir_buf = NULL; | 1304 | void *dir_buf = NULL; |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index cbfe13bf5b2a..521bd4ab8abe 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -2959,7 +2959,7 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, | |||
2959 | ssize_t size, void *private, int ret, | 2959 | ssize_t size, void *private, int ret, |
2960 | bool is_async) | 2960 | bool is_async) |
2961 | { | 2961 | { |
2962 | struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; | 2962 | struct inode *inode = file_inode(iocb->ki_filp); |
2963 | ext4_io_end_t *io_end = iocb->private; | 2963 | ext4_io_end_t *io_end = iocb->private; |
2964 | 2964 | ||
2965 | /* if not async direct IO or dio with 0 bytes write, just return */ | 2965 | /* if not async direct IO or dio with 0 bytes write, just return */ |
@@ -3553,7 +3553,7 @@ int ext4_can_truncate(struct inode *inode) | |||
3553 | 3553 | ||
3554 | int ext4_punch_hole(struct file *file, loff_t offset, loff_t length) | 3554 | int ext4_punch_hole(struct file *file, loff_t offset, loff_t length) |
3555 | { | 3555 | { |
3556 | struct inode *inode = file->f_path.dentry->d_inode; | 3556 | struct inode *inode = file_inode(file); |
3557 | if (!S_ISREG(inode->i_mode)) | 3557 | if (!S_ISREG(inode->i_mode)) |
3558 | return -EOPNOTSUPP; | 3558 | return -EOPNOTSUPP; |
3559 | 3559 | ||
@@ -4926,7 +4926,7 @@ int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
4926 | unsigned long len; | 4926 | unsigned long len; |
4927 | int ret; | 4927 | int ret; |
4928 | struct file *file = vma->vm_file; | 4928 | struct file *file = vma->vm_file; |
4929 | struct inode *inode = file->f_path.dentry->d_inode; | 4929 | struct inode *inode = file_inode(file); |
4930 | struct address_space *mapping = inode->i_mapping; | 4930 | struct address_space *mapping = inode->i_mapping; |
4931 | handle_t *handle; | 4931 | handle_t *handle; |
4932 | get_block_t *get_block; | 4932 | get_block_t *get_block; |
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 5747f52f7c72..c2f8e060f636 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 23 | long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
24 | { | 24 | { |
25 | struct inode *inode = filp->f_dentry->d_inode; | 25 | struct inode *inode = file_inode(filp); |
26 | struct super_block *sb = inode->i_sb; | 26 | struct super_block *sb = inode->i_sb; |
27 | struct ext4_inode_info *ei = EXT4_I(inode); | 27 | struct ext4_inode_info *ei = EXT4_I(inode); |
28 | unsigned int flags; | 28 | unsigned int flags; |
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index d9cc5ee42f53..796f7ac03706 100644 --- a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c | |||
@@ -900,7 +900,7 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode, | |||
900 | pgoff_t orig_page_offset, int data_offset_in_page, | 900 | pgoff_t orig_page_offset, int data_offset_in_page, |
901 | int block_len_in_page, int uninit, int *err) | 901 | int block_len_in_page, int uninit, int *err) |
902 | { | 902 | { |
903 | struct inode *orig_inode = o_filp->f_dentry->d_inode; | 903 | struct inode *orig_inode = file_inode(o_filp); |
904 | struct page *pagep[2] = {NULL, NULL}; | 904 | struct page *pagep[2] = {NULL, NULL}; |
905 | handle_t *handle; | 905 | handle_t *handle; |
906 | ext4_lblk_t orig_blk_offset; | 906 | ext4_lblk_t orig_blk_offset; |
@@ -1279,8 +1279,8 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp, | |||
1279 | __u64 orig_start, __u64 donor_start, __u64 len, | 1279 | __u64 orig_start, __u64 donor_start, __u64 len, |
1280 | __u64 *moved_len) | 1280 | __u64 *moved_len) |
1281 | { | 1281 | { |
1282 | struct inode *orig_inode = o_filp->f_dentry->d_inode; | 1282 | struct inode *orig_inode = file_inode(o_filp); |
1283 | struct inode *donor_inode = d_filp->f_dentry->d_inode; | 1283 | struct inode *donor_inode = file_inode(d_filp); |
1284 | struct ext4_ext_path *orig_path = NULL, *holecheck_path = NULL; | 1284 | struct ext4_ext_path *orig_path = NULL, *holecheck_path = NULL; |
1285 | struct ext4_extent *ext_prev, *ext_cur, *ext_dummy; | 1285 | struct ext4_extent *ext_prev, *ext_cur, *ext_dummy; |
1286 | ext4_lblk_t block_start = orig_start; | 1286 | ext4_lblk_t block_start = orig_start; |
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index f9ed946a448e..bb97ad6905b2 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -937,7 +937,7 @@ int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash, | |||
937 | 937 | ||
938 | dxtrace(printk(KERN_DEBUG "In htree_fill_tree, start hash: %x:%x\n", | 938 | dxtrace(printk(KERN_DEBUG "In htree_fill_tree, start hash: %x:%x\n", |
939 | start_hash, start_minor_hash)); | 939 | start_hash, start_minor_hash)); |
940 | dir = dir_file->f_path.dentry->d_inode; | 940 | dir = file_inode(dir_file); |
941 | if (!(ext4_test_inode_flag(dir, EXT4_INODE_INDEX))) { | 941 | if (!(ext4_test_inode_flag(dir, EXT4_INODE_INDEX))) { |
942 | hinfo.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version; | 942 | hinfo.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version; |
943 | if (hinfo.hash_version <= DX_HASH_TEA) | 943 | if (hinfo.hash_version <= DX_HASH_TEA) |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 3d4fb81bacd5..4df78dd3f523 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -553,7 +553,7 @@ void ext4_error_file(struct file *file, const char *function, | |||
553 | va_list args; | 553 | va_list args; |
554 | struct va_format vaf; | 554 | struct va_format vaf; |
555 | struct ext4_super_block *es; | 555 | struct ext4_super_block *es; |
556 | struct inode *inode = file->f_dentry->d_inode; | 556 | struct inode *inode = file_inode(file); |
557 | char pathname[80], *path; | 557 | char pathname[80], *path; |
558 | 558 | ||
559 | es = EXT4_SB(inode->i_sb)->s_es; | 559 | es = EXT4_SB(inode->i_sb)->s_es; |
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 951ed52748f6..fda0bcc0907f 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c | |||
@@ -603,7 +603,7 @@ bool f2fs_empty_dir(struct inode *dir) | |||
603 | static int f2fs_readdir(struct file *file, void *dirent, filldir_t filldir) | 603 | static int f2fs_readdir(struct file *file, void *dirent, filldir_t filldir) |
604 | { | 604 | { |
605 | unsigned long pos = file->f_pos; | 605 | unsigned long pos = file->f_pos; |
606 | struct inode *inode = file->f_dentry->d_inode; | 606 | struct inode *inode = file_inode(file); |
607 | unsigned long npages = dir_blocks(inode); | 607 | unsigned long npages = dir_blocks(inode); |
608 | unsigned char *types = NULL; | 608 | unsigned char *types = NULL; |
609 | unsigned int bit_pos = 0, start_bit_pos = 0; | 609 | unsigned int bit_pos = 0, start_bit_pos = 0; |
diff --git a/fs/fat/dir.c b/fs/fat/dir.c index 58bf744dbf39..165012ef363a 100644 --- a/fs/fat/dir.c +++ b/fs/fat/dir.c | |||
@@ -698,7 +698,7 @@ out: | |||
698 | 698 | ||
699 | static int fat_readdir(struct file *filp, void *dirent, filldir_t filldir) | 699 | static int fat_readdir(struct file *filp, void *dirent, filldir_t filldir) |
700 | { | 700 | { |
701 | struct inode *inode = filp->f_path.dentry->d_inode; | 701 | struct inode *inode = file_inode(filp); |
702 | return __fat_readdir(inode, filp, dirent, filldir, 0, 0); | 702 | return __fat_readdir(inode, filp, dirent, filldir, 0, 0); |
703 | } | 703 | } |
704 | 704 | ||
@@ -779,7 +779,7 @@ static int fat_ioctl_readdir(struct inode *inode, struct file *filp, | |||
779 | static long fat_dir_ioctl(struct file *filp, unsigned int cmd, | 779 | static long fat_dir_ioctl(struct file *filp, unsigned int cmd, |
780 | unsigned long arg) | 780 | unsigned long arg) |
781 | { | 781 | { |
782 | struct inode *inode = filp->f_path.dentry->d_inode; | 782 | struct inode *inode = file_inode(filp); |
783 | struct __fat_dirent __user *d1 = (struct __fat_dirent __user *)arg; | 783 | struct __fat_dirent __user *d1 = (struct __fat_dirent __user *)arg; |
784 | int short_only, both; | 784 | int short_only, both; |
785 | 785 | ||
@@ -819,7 +819,7 @@ FAT_IOCTL_FILLDIR_FUNC(fat_compat_ioctl_filldir, compat_dirent) | |||
819 | static long fat_compat_dir_ioctl(struct file *filp, unsigned cmd, | 819 | static long fat_compat_dir_ioctl(struct file *filp, unsigned cmd, |
820 | unsigned long arg) | 820 | unsigned long arg) |
821 | { | 821 | { |
822 | struct inode *inode = filp->f_path.dentry->d_inode; | 822 | struct inode *inode = file_inode(filp); |
823 | struct compat_dirent __user *d1 = compat_ptr(arg); | 823 | struct compat_dirent __user *d1 = compat_ptr(arg); |
824 | int short_only, both; | 824 | int short_only, both; |
825 | 825 | ||
diff --git a/fs/fat/file.c b/fs/fat/file.c index a62e0ecbe2db..3978f8ca1823 100644 --- a/fs/fat/file.c +++ b/fs/fat/file.c | |||
@@ -32,7 +32,7 @@ static int fat_ioctl_get_attributes(struct inode *inode, u32 __user *user_attr) | |||
32 | 32 | ||
33 | static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr) | 33 | static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr) |
34 | { | 34 | { |
35 | struct inode *inode = file->f_path.dentry->d_inode; | 35 | struct inode *inode = file_inode(file); |
36 | struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); | 36 | struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); |
37 | int is_dir = S_ISDIR(inode->i_mode); | 37 | int is_dir = S_ISDIR(inode->i_mode); |
38 | u32 attr, oldattr; | 38 | u32 attr, oldattr; |
@@ -116,7 +116,7 @@ out: | |||
116 | 116 | ||
117 | long fat_generic_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 117 | long fat_generic_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
118 | { | 118 | { |
119 | struct inode *inode = filp->f_path.dentry->d_inode; | 119 | struct inode *inode = file_inode(filp); |
120 | u32 __user *user_attr = (u32 __user *)arg; | 120 | u32 __user *user_attr = (u32 __user *)arg; |
121 | 121 | ||
122 | switch (cmd) { | 122 | switch (cmd) { |
diff --git a/fs/fcntl.c b/fs/fcntl.c index 71a600a19f06..6599222536eb 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | static int setfl(int fd, struct file * filp, unsigned long arg) | 31 | static int setfl(int fd, struct file * filp, unsigned long arg) |
32 | { | 32 | { |
33 | struct inode * inode = filp->f_path.dentry->d_inode; | 33 | struct inode * inode = file_inode(filp); |
34 | int error = 0; | 34 | int error = 0; |
35 | 35 | ||
36 | /* | 36 | /* |
diff --git a/fs/file_table.c b/fs/file_table.c index de9e9653d611..0f607ce89acc 100644 --- a/fs/file_table.c +++ b/fs/file_table.c | |||
@@ -447,7 +447,7 @@ void mark_files_ro(struct super_block *sb) | |||
447 | 447 | ||
448 | lg_global_lock(&files_lglock); | 448 | lg_global_lock(&files_lglock); |
449 | do_file_list_for_each_entry(sb, f) { | 449 | do_file_list_for_each_entry(sb, f) { |
450 | if (!S_ISREG(f->f_path.dentry->d_inode->i_mode)) | 450 | if (!S_ISREG(file_inode(f)->i_mode)) |
451 | continue; | 451 | continue; |
452 | if (!file_count(f)) | 452 | if (!file_count(f)) |
453 | continue; | 453 | continue; |
diff --git a/fs/freevxfs/vxfs_lookup.c b/fs/freevxfs/vxfs_lookup.c index bd447e88f208..664b07a53870 100644 --- a/fs/freevxfs/vxfs_lookup.c +++ b/fs/freevxfs/vxfs_lookup.c | |||
@@ -237,7 +237,7 @@ vxfs_lookup(struct inode *dip, struct dentry *dp, unsigned int flags) | |||
237 | static int | 237 | static int |
238 | vxfs_readdir(struct file *fp, void *retp, filldir_t filler) | 238 | vxfs_readdir(struct file *fp, void *retp, filldir_t filler) |
239 | { | 239 | { |
240 | struct inode *ip = fp->f_path.dentry->d_inode; | 240 | struct inode *ip = file_inode(fp); |
241 | struct super_block *sbp = ip->i_sb; | 241 | struct super_block *sbp = ip->i_sb; |
242 | u_long bsize = sbp->s_blocksize; | 242 | u_long bsize = sbp->s_blocksize; |
243 | u_long page, npages, block, pblocks, nblocks, offset; | 243 | u_long page, npages, block, pblocks, nblocks, offset; |
diff --git a/fs/fuse/control.c b/fs/fuse/control.c index 75a20c092dd4..b7978b9f75ef 100644 --- a/fs/fuse/control.c +++ b/fs/fuse/control.c | |||
@@ -23,7 +23,7 @@ static struct fuse_conn *fuse_ctl_file_conn_get(struct file *file) | |||
23 | { | 23 | { |
24 | struct fuse_conn *fc; | 24 | struct fuse_conn *fc; |
25 | mutex_lock(&fuse_mutex); | 25 | mutex_lock(&fuse_mutex); |
26 | fc = file->f_path.dentry->d_inode->i_private; | 26 | fc = file_inode(file)->i_private; |
27 | if (fc) | 27 | if (fc) |
28 | fc = fuse_conn_get(fc); | 28 | fc = fuse_conn_get(fc); |
29 | mutex_unlock(&fuse_mutex); | 29 | mutex_unlock(&fuse_mutex); |
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index b7c09f9eb40c..80ba3950c40d 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -1160,7 +1160,7 @@ static int fuse_readdir(struct file *file, void *dstbuf, filldir_t filldir) | |||
1160 | int err; | 1160 | int err; |
1161 | size_t nbytes; | 1161 | size_t nbytes; |
1162 | struct page *page; | 1162 | struct page *page; |
1163 | struct inode *inode = file->f_path.dentry->d_inode; | 1163 | struct inode *inode = file_inode(file); |
1164 | struct fuse_conn *fc = get_fuse_conn(inode); | 1164 | struct fuse_conn *fc = get_fuse_conn(inode); |
1165 | struct fuse_req *req; | 1165 | struct fuse_req *req; |
1166 | 1166 | ||
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 991ab2d484dd..44543df9f400 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c | |||
@@ -157,7 +157,7 @@ static const u32 gfs2_to_fsflags[32] = { | |||
157 | 157 | ||
158 | static int gfs2_get_flags(struct file *filp, u32 __user *ptr) | 158 | static int gfs2_get_flags(struct file *filp, u32 __user *ptr) |
159 | { | 159 | { |
160 | struct inode *inode = filp->f_path.dentry->d_inode; | 160 | struct inode *inode = file_inode(filp); |
161 | struct gfs2_inode *ip = GFS2_I(inode); | 161 | struct gfs2_inode *ip = GFS2_I(inode); |
162 | struct gfs2_holder gh; | 162 | struct gfs2_holder gh; |
163 | int error; | 163 | int error; |
@@ -217,7 +217,7 @@ void gfs2_set_inode_flags(struct inode *inode) | |||
217 | */ | 217 | */ |
218 | static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask) | 218 | static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask) |
219 | { | 219 | { |
220 | struct inode *inode = filp->f_path.dentry->d_inode; | 220 | struct inode *inode = file_inode(filp); |
221 | struct gfs2_inode *ip = GFS2_I(inode); | 221 | struct gfs2_inode *ip = GFS2_I(inode); |
222 | struct gfs2_sbd *sdp = GFS2_SB(inode); | 222 | struct gfs2_sbd *sdp = GFS2_SB(inode); |
223 | struct buffer_head *bh; | 223 | struct buffer_head *bh; |
@@ -293,7 +293,7 @@ out_drop_write: | |||
293 | 293 | ||
294 | static int gfs2_set_flags(struct file *filp, u32 __user *ptr) | 294 | static int gfs2_set_flags(struct file *filp, u32 __user *ptr) |
295 | { | 295 | { |
296 | struct inode *inode = filp->f_path.dentry->d_inode; | 296 | struct inode *inode = file_inode(filp); |
297 | u32 fsflags, gfsflags; | 297 | u32 fsflags, gfsflags; |
298 | 298 | ||
299 | if (get_user(fsflags, ptr)) | 299 | if (get_user(fsflags, ptr)) |
@@ -336,7 +336,7 @@ static long gfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
336 | 336 | ||
337 | static void gfs2_size_hint(struct file *filep, loff_t offset, size_t size) | 337 | static void gfs2_size_hint(struct file *filep, loff_t offset, size_t size) |
338 | { | 338 | { |
339 | struct inode *inode = filep->f_dentry->d_inode; | 339 | struct inode *inode = file_inode(filep); |
340 | struct gfs2_sbd *sdp = GFS2_SB(inode); | 340 | struct gfs2_sbd *sdp = GFS2_SB(inode); |
341 | struct gfs2_inode *ip = GFS2_I(inode); | 341 | struct gfs2_inode *ip = GFS2_I(inode); |
342 | size_t blks = (size + sdp->sd_sb.sb_bsize - 1) >> sdp->sd_sb.sb_bsize_shift; | 342 | size_t blks = (size + sdp->sd_sb.sb_bsize - 1) >> sdp->sd_sb.sb_bsize_shift; |
@@ -386,7 +386,7 @@ static int gfs2_allocate_page_backing(struct page *page) | |||
386 | static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | 386 | static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) |
387 | { | 387 | { |
388 | struct page *page = vmf->page; | 388 | struct page *page = vmf->page; |
389 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; | 389 | struct inode *inode = file_inode(vma->vm_file); |
390 | struct gfs2_inode *ip = GFS2_I(inode); | 390 | struct gfs2_inode *ip = GFS2_I(inode); |
391 | struct gfs2_sbd *sdp = GFS2_SB(inode); | 391 | struct gfs2_sbd *sdp = GFS2_SB(inode); |
392 | unsigned long last_index; | 392 | unsigned long last_index; |
@@ -673,8 +673,7 @@ static ssize_t gfs2_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
673 | { | 673 | { |
674 | struct file *file = iocb->ki_filp; | 674 | struct file *file = iocb->ki_filp; |
675 | size_t writesize = iov_length(iov, nr_segs); | 675 | size_t writesize = iov_length(iov, nr_segs); |
676 | struct dentry *dentry = file->f_dentry; | 676 | struct gfs2_inode *ip = GFS2_I(file_inode(file)); |
677 | struct gfs2_inode *ip = GFS2_I(dentry->d_inode); | ||
678 | int ret; | 677 | int ret; |
679 | 678 | ||
680 | ret = gfs2_rs_alloc(ip); | 679 | ret = gfs2_rs_alloc(ip); |
@@ -772,7 +771,7 @@ static void calc_max_reserv(struct gfs2_inode *ip, loff_t max, loff_t *len, | |||
772 | static long gfs2_fallocate(struct file *file, int mode, loff_t offset, | 771 | static long gfs2_fallocate(struct file *file, int mode, loff_t offset, |
773 | loff_t len) | 772 | loff_t len) |
774 | { | 773 | { |
775 | struct inode *inode = file->f_path.dentry->d_inode; | 774 | struct inode *inode = file_inode(file); |
776 | struct gfs2_sbd *sdp = GFS2_SB(inode); | 775 | struct gfs2_sbd *sdp = GFS2_SB(inode); |
777 | struct gfs2_inode *ip = GFS2_I(inode); | 776 | struct gfs2_inode *ip = GFS2_I(inode); |
778 | unsigned int data_blocks = 0, ind_blocks = 0, rblocks; | 777 | unsigned int data_blocks = 0, ind_blocks = 0, rblocks; |
@@ -938,7 +937,7 @@ static int do_flock(struct file *file, int cmd, struct file_lock *fl) | |||
938 | { | 937 | { |
939 | struct gfs2_file *fp = file->private_data; | 938 | struct gfs2_file *fp = file->private_data; |
940 | struct gfs2_holder *fl_gh = &fp->f_fl_gh; | 939 | struct gfs2_holder *fl_gh = &fp->f_fl_gh; |
941 | struct gfs2_inode *ip = GFS2_I(file->f_path.dentry->d_inode); | 940 | struct gfs2_inode *ip = GFS2_I(file_inode(file)); |
942 | struct gfs2_glock *gl; | 941 | struct gfs2_glock *gl; |
943 | unsigned int state; | 942 | unsigned int state; |
944 | int flags; | 943 | int flags; |
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index b7eff078fe90..04af1cf7ae34 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -1257,7 +1257,7 @@ fail: | |||
1257 | 1257 | ||
1258 | int gfs2_fitrim(struct file *filp, void __user *argp) | 1258 | int gfs2_fitrim(struct file *filp, void __user *argp) |
1259 | { | 1259 | { |
1260 | struct inode *inode = filp->f_dentry->d_inode; | 1260 | struct inode *inode = file_inode(filp); |
1261 | struct gfs2_sbd *sdp = GFS2_SB(inode); | 1261 | struct gfs2_sbd *sdp = GFS2_SB(inode); |
1262 | struct request_queue *q = bdev_get_queue(sdp->sd_vfs->s_bdev); | 1262 | struct request_queue *q = bdev_get_queue(sdp->sd_vfs->s_bdev); |
1263 | struct buffer_head *bh; | 1263 | struct buffer_head *bh; |
diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index 422dde2ec0a1..5f7f1abd5f6d 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c | |||
@@ -51,7 +51,7 @@ done: | |||
51 | */ | 51 | */ |
52 | static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | 52 | static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) |
53 | { | 53 | { |
54 | struct inode *inode = filp->f_path.dentry->d_inode; | 54 | struct inode *inode = file_inode(filp); |
55 | struct super_block *sb = inode->i_sb; | 55 | struct super_block *sb = inode->i_sb; |
56 | int len, err; | 56 | int len, err; |
57 | char strbuf[HFS_MAX_NAMELEN]; | 57 | char strbuf[HFS_MAX_NAMELEN]; |
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index d47f11658c17..3031dfdd2358 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c | |||
@@ -128,7 +128,7 @@ static ssize_t hfs_direct_IO(int rw, struct kiocb *iocb, | |||
128 | { | 128 | { |
129 | struct file *file = iocb->ki_filp; | 129 | struct file *file = iocb->ki_filp; |
130 | struct address_space *mapping = file->f_mapping; | 130 | struct address_space *mapping = file->f_mapping; |
131 | struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host; | 131 | struct inode *inode = file_inode(file)->i_mapping->host; |
132 | ssize_t ret; | 132 | ssize_t ret; |
133 | 133 | ||
134 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, | 134 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, |
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index 6b9f921ef2fa..074e04589248 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c | |||
@@ -122,7 +122,7 @@ fail: | |||
122 | 122 | ||
123 | static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) | 123 | static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) |
124 | { | 124 | { |
125 | struct inode *inode = filp->f_path.dentry->d_inode; | 125 | struct inode *inode = file_inode(filp); |
126 | struct super_block *sb = inode->i_sb; | 126 | struct super_block *sb = inode->i_sb; |
127 | int len, err; | 127 | int len, err; |
128 | char strbuf[HFSPLUS_MAX_STRLEN + 1]; | 128 | char strbuf[HFSPLUS_MAX_STRLEN + 1]; |
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 799b336b59f9..dcd05be5344b 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -124,7 +124,7 @@ static ssize_t hfsplus_direct_IO(int rw, struct kiocb *iocb, | |||
124 | { | 124 | { |
125 | struct file *file = iocb->ki_filp; | 125 | struct file *file = iocb->ki_filp; |
126 | struct address_space *mapping = file->f_mapping; | 126 | struct address_space *mapping = file->f_mapping; |
127 | struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host; | 127 | struct inode *inode = file_inode(file)->i_mapping->host; |
128 | ssize_t ret; | 128 | ssize_t ret; |
129 | 129 | ||
130 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, | 130 | ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, |
diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c index 09addc8615fa..e3c4c4209428 100644 --- a/fs/hfsplus/ioctl.c +++ b/fs/hfsplus/ioctl.c | |||
@@ -59,7 +59,7 @@ static int hfsplus_ioctl_bless(struct file *file, int __user *user_flags) | |||
59 | 59 | ||
60 | static int hfsplus_ioctl_getflags(struct file *file, int __user *user_flags) | 60 | static int hfsplus_ioctl_getflags(struct file *file, int __user *user_flags) |
61 | { | 61 | { |
62 | struct inode *inode = file->f_path.dentry->d_inode; | 62 | struct inode *inode = file_inode(file); |
63 | struct hfsplus_inode_info *hip = HFSPLUS_I(inode); | 63 | struct hfsplus_inode_info *hip = HFSPLUS_I(inode); |
64 | unsigned int flags = 0; | 64 | unsigned int flags = 0; |
65 | 65 | ||
@@ -75,7 +75,7 @@ static int hfsplus_ioctl_getflags(struct file *file, int __user *user_flags) | |||
75 | 75 | ||
76 | static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags) | 76 | static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags) |
77 | { | 77 | { |
78 | struct inode *inode = file->f_path.dentry->d_inode; | 78 | struct inode *inode = file_inode(file); |
79 | struct hfsplus_inode_info *hip = HFSPLUS_I(inode); | 79 | struct hfsplus_inode_info *hip = HFSPLUS_I(inode); |
80 | unsigned int flags; | 80 | unsigned int flags; |
81 | int err = 0; | 81 | int err = 0; |
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 457addc5c91f..ba6de25771ac 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -30,7 +30,7 @@ static inline struct hostfs_inode_info *HOSTFS_I(struct inode *inode) | |||
30 | return list_entry(inode, struct hostfs_inode_info, vfs_inode); | 30 | return list_entry(inode, struct hostfs_inode_info, vfs_inode); |
31 | } | 31 | } |
32 | 32 | ||
33 | #define FILE_HOSTFS_I(file) HOSTFS_I((file)->f_path.dentry->d_inode) | 33 | #define FILE_HOSTFS_I(file) HOSTFS_I(file_inode(file)) |
34 | 34 | ||
35 | static int hostfs_d_delete(const struct dentry *dentry) | 35 | static int hostfs_d_delete(const struct dentry *dentry) |
36 | { | 36 | { |
diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c index 78e12b2e0ea2..546f6d39713a 100644 --- a/fs/hpfs/dir.c +++ b/fs/hpfs/dir.c | |||
@@ -25,7 +25,7 @@ static loff_t hpfs_dir_lseek(struct file *filp, loff_t off, int whence) | |||
25 | loff_t new_off = off + (whence == 1 ? filp->f_pos : 0); | 25 | loff_t new_off = off + (whence == 1 ? filp->f_pos : 0); |
26 | loff_t pos; | 26 | loff_t pos; |
27 | struct quad_buffer_head qbh; | 27 | struct quad_buffer_head qbh; |
28 | struct inode *i = filp->f_path.dentry->d_inode; | 28 | struct inode *i = file_inode(filp); |
29 | struct hpfs_inode_info *hpfs_inode = hpfs_i(i); | 29 | struct hpfs_inode_info *hpfs_inode = hpfs_i(i); |
30 | struct super_block *s = i->i_sb; | 30 | struct super_block *s = i->i_sb; |
31 | 31 | ||
@@ -57,7 +57,7 @@ fail: | |||
57 | 57 | ||
58 | static int hpfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | 58 | static int hpfs_readdir(struct file *filp, void *dirent, filldir_t filldir) |
59 | { | 59 | { |
60 | struct inode *inode = filp->f_path.dentry->d_inode; | 60 | struct inode *inode = file_inode(filp); |
61 | struct hpfs_inode_info *hpfs_inode = hpfs_i(inode); | 61 | struct hpfs_inode_info *hpfs_inode = hpfs_i(inode); |
62 | struct quad_buffer_head qbh; | 62 | struct quad_buffer_head qbh; |
63 | struct hpfs_dirent *de; | 63 | struct hpfs_dirent *de; |
diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c index fbfe2df5624b..9f9dbeceeee7 100644 --- a/fs/hpfs/file.c +++ b/fs/hpfs/file.c | |||
@@ -152,7 +152,7 @@ static ssize_t hpfs_file_write(struct file *file, const char __user *buf, | |||
152 | retval = do_sync_write(file, buf, count, ppos); | 152 | retval = do_sync_write(file, buf, count, ppos); |
153 | if (retval > 0) { | 153 | if (retval > 0) { |
154 | hpfs_lock(file->f_path.dentry->d_sb); | 154 | hpfs_lock(file->f_path.dentry->d_sb); |
155 | hpfs_i(file->f_path.dentry->d_inode)->i_dirty = 1; | 155 | hpfs_i(file_inode(file))->i_dirty = 1; |
156 | hpfs_unlock(file->f_path.dentry->d_sb); | 156 | hpfs_unlock(file->f_path.dentry->d_sb); |
157 | } | 157 | } |
158 | return retval; | 158 | return retval; |
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c index 43b315f2002b..74f55703be49 100644 --- a/fs/hppfs/hppfs.c +++ b/fs/hppfs/hppfs.c | |||
@@ -180,7 +180,7 @@ static ssize_t read_proc(struct file *file, char __user *buf, ssize_t count, | |||
180 | ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); | 180 | ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); |
181 | ssize_t n; | 181 | ssize_t n; |
182 | 182 | ||
183 | read = file->f_path.dentry->d_inode->i_fop->read; | 183 | read = file_inode(file)->i_fop->read; |
184 | 184 | ||
185 | if (!is_user) | 185 | if (!is_user) |
186 | set_fs(KERNEL_DS); | 186 | set_fs(KERNEL_DS); |
@@ -288,7 +288,7 @@ static ssize_t hppfs_write(struct file *file, const char __user *buf, | |||
288 | struct file *proc_file = data->proc_file; | 288 | struct file *proc_file = data->proc_file; |
289 | ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *); | 289 | ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *); |
290 | 290 | ||
291 | write = proc_file->f_path.dentry->d_inode->i_fop->write; | 291 | write = file_inode(proc_file)->i_fop->write; |
292 | return (*write)(proc_file, buf, len, ppos); | 292 | return (*write)(proc_file, buf, len, ppos); |
293 | } | 293 | } |
294 | 294 | ||
@@ -513,7 +513,7 @@ static loff_t hppfs_llseek(struct file *file, loff_t off, int where) | |||
513 | loff_t (*llseek)(struct file *, loff_t, int); | 513 | loff_t (*llseek)(struct file *, loff_t, int); |
514 | loff_t ret; | 514 | loff_t ret; |
515 | 515 | ||
516 | llseek = proc_file->f_path.dentry->d_inode->i_fop->llseek; | 516 | llseek = file_inode(proc_file)->i_fop->llseek; |
517 | if (llseek != NULL) { | 517 | if (llseek != NULL) { |
518 | ret = (*llseek)(proc_file, off, where); | 518 | ret = (*llseek)(proc_file, off, where); |
519 | if (ret < 0) | 519 | if (ret < 0) |
@@ -561,7 +561,7 @@ static int hppfs_readdir(struct file *file, void *ent, filldir_t filldir) | |||
561 | }); | 561 | }); |
562 | int err; | 562 | int err; |
563 | 563 | ||
564 | readdir = proc_file->f_path.dentry->d_inode->i_fop->readdir; | 564 | readdir = file_inode(proc_file)->i_fop->readdir; |
565 | 565 | ||
566 | proc_file->f_pos = file->f_pos; | 566 | proc_file->f_pos = file->f_pos; |
567 | err = (*readdir)(proc_file, &dirent, hppfs_filldir); | 567 | err = (*readdir)(proc_file, &dirent, hppfs_filldir); |
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 78bde32ea951..edb42ea60c76 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -97,7 +97,7 @@ static void huge_pagevec_release(struct pagevec *pvec) | |||
97 | 97 | ||
98 | static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma) | 98 | static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma) |
99 | { | 99 | { |
100 | struct inode *inode = file->f_path.dentry->d_inode; | 100 | struct inode *inode = file_inode(file); |
101 | loff_t len, vma_len; | 101 | loff_t len, vma_len; |
102 | int ret; | 102 | int ret; |
103 | struct hstate *h = hstate_file(file); | 103 | struct hstate *h = hstate_file(file); |
diff --git a/fs/inode.c b/fs/inode.c index 14084b72b259..67880e604399 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -1655,7 +1655,7 @@ EXPORT_SYMBOL(file_remove_suid); | |||
1655 | 1655 | ||
1656 | int file_update_time(struct file *file) | 1656 | int file_update_time(struct file *file) |
1657 | { | 1657 | { |
1658 | struct inode *inode = file->f_path.dentry->d_inode; | 1658 | struct inode *inode = file_inode(file); |
1659 | struct timespec now; | 1659 | struct timespec now; |
1660 | int sync_it = 0; | 1660 | int sync_it = 0; |
1661 | int ret; | 1661 | int ret; |
diff --git a/fs/ioctl.c b/fs/ioctl.c index 3bdad6d1f268..fd507fb460f8 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c | |||
@@ -175,7 +175,7 @@ static int ioctl_fiemap(struct file *filp, unsigned long arg) | |||
175 | struct fiemap fiemap; | 175 | struct fiemap fiemap; |
176 | struct fiemap __user *ufiemap = (struct fiemap __user *) arg; | 176 | struct fiemap __user *ufiemap = (struct fiemap __user *) arg; |
177 | struct fiemap_extent_info fieinfo = { 0, }; | 177 | struct fiemap_extent_info fieinfo = { 0, }; |
178 | struct inode *inode = filp->f_path.dentry->d_inode; | 178 | struct inode *inode = file_inode(filp); |
179 | struct super_block *sb = inode->i_sb; | 179 | struct super_block *sb = inode->i_sb; |
180 | u64 len; | 180 | u64 len; |
181 | int error; | 181 | int error; |
@@ -424,7 +424,7 @@ EXPORT_SYMBOL(generic_block_fiemap); | |||
424 | */ | 424 | */ |
425 | int ioctl_preallocate(struct file *filp, void __user *argp) | 425 | int ioctl_preallocate(struct file *filp, void __user *argp) |
426 | { | 426 | { |
427 | struct inode *inode = filp->f_path.dentry->d_inode; | 427 | struct inode *inode = file_inode(filp); |
428 | struct space_resv sr; | 428 | struct space_resv sr; |
429 | 429 | ||
430 | if (copy_from_user(&sr, argp, sizeof(sr))) | 430 | if (copy_from_user(&sr, argp, sizeof(sr))) |
@@ -449,7 +449,7 @@ int ioctl_preallocate(struct file *filp, void __user *argp) | |||
449 | static int file_ioctl(struct file *filp, unsigned int cmd, | 449 | static int file_ioctl(struct file *filp, unsigned int cmd, |
450 | unsigned long arg) | 450 | unsigned long arg) |
451 | { | 451 | { |
452 | struct inode *inode = filp->f_path.dentry->d_inode; | 452 | struct inode *inode = file_inode(filp); |
453 | int __user *p = (int __user *)arg; | 453 | int __user *p = (int __user *)arg; |
454 | 454 | ||
455 | switch (cmd) { | 455 | switch (cmd) { |
@@ -512,7 +512,7 @@ static int ioctl_fioasync(unsigned int fd, struct file *filp, | |||
512 | 512 | ||
513 | static int ioctl_fsfreeze(struct file *filp) | 513 | static int ioctl_fsfreeze(struct file *filp) |
514 | { | 514 | { |
515 | struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; | 515 | struct super_block *sb = file_inode(filp)->i_sb; |
516 | 516 | ||
517 | if (!capable(CAP_SYS_ADMIN)) | 517 | if (!capable(CAP_SYS_ADMIN)) |
518 | return -EPERM; | 518 | return -EPERM; |
@@ -527,7 +527,7 @@ static int ioctl_fsfreeze(struct file *filp) | |||
527 | 527 | ||
528 | static int ioctl_fsthaw(struct file *filp) | 528 | static int ioctl_fsthaw(struct file *filp) |
529 | { | 529 | { |
530 | struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; | 530 | struct super_block *sb = file_inode(filp)->i_sb; |
531 | 531 | ||
532 | if (!capable(CAP_SYS_ADMIN)) | 532 | if (!capable(CAP_SYS_ADMIN)) |
533 | return -EPERM; | 533 | return -EPERM; |
@@ -548,7 +548,7 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | |||
548 | { | 548 | { |
549 | int error = 0; | 549 | int error = 0; |
550 | int __user *argp = (int __user *)arg; | 550 | int __user *argp = (int __user *)arg; |
551 | struct inode *inode = filp->f_path.dentry->d_inode; | 551 | struct inode *inode = file_inode(filp); |
552 | 552 | ||
553 | switch (cmd) { | 553 | switch (cmd) { |
554 | case FIOCLEX: | 554 | case FIOCLEX: |
diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c index 0b3fa7974fa8..592e5115a561 100644 --- a/fs/isofs/compress.c +++ b/fs/isofs/compress.c | |||
@@ -296,7 +296,7 @@ static int zisofs_fill_pages(struct inode *inode, int full_page, int pcount, | |||
296 | */ | 296 | */ |
297 | static int zisofs_readpage(struct file *file, struct page *page) | 297 | static int zisofs_readpage(struct file *file, struct page *page) |
298 | { | 298 | { |
299 | struct inode *inode = file->f_path.dentry->d_inode; | 299 | struct inode *inode = file_inode(file); |
300 | struct address_space *mapping = inode->i_mapping; | 300 | struct address_space *mapping = inode->i_mapping; |
301 | int err; | 301 | int err; |
302 | int i, pcount, full_page; | 302 | int i, pcount, full_page; |
diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c index f20437c068a0..a7d5c3c3d4e6 100644 --- a/fs/isofs/dir.c +++ b/fs/isofs/dir.c | |||
@@ -253,7 +253,7 @@ static int isofs_readdir(struct file *filp, | |||
253 | int result; | 253 | int result; |
254 | char *tmpname; | 254 | char *tmpname; |
255 | struct iso_directory_record *tmpde; | 255 | struct iso_directory_record *tmpde; |
256 | struct inode *inode = filp->f_path.dentry->d_inode; | 256 | struct inode *inode = file_inode(filp); |
257 | 257 | ||
258 | tmpname = (char *)__get_free_page(GFP_KERNEL); | 258 | tmpname = (char *)__get_free_page(GFP_KERNEL); |
259 | if (tmpname == NULL) | 259 | if (tmpname == NULL) |
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index ad7774d32095..acd46a4160cb 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c | |||
@@ -117,12 +117,12 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target, | |||
117 | static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir) | 117 | static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir) |
118 | { | 118 | { |
119 | struct jffs2_inode_info *f; | 119 | struct jffs2_inode_info *f; |
120 | struct inode *inode = filp->f_path.dentry->d_inode; | 120 | struct inode *inode = file_inode(filp); |
121 | struct jffs2_full_dirent *fd; | 121 | struct jffs2_full_dirent *fd; |
122 | unsigned long offset, curofs; | 122 | unsigned long offset, curofs; |
123 | 123 | ||
124 | jffs2_dbg(1, "jffs2_readdir() for dir_i #%lu\n", | 124 | jffs2_dbg(1, "jffs2_readdir() for dir_i #%lu\n", |
125 | filp->f_path.dentry->d_inode->i_ino); | 125 | file_inode(filp)->i_ino); |
126 | 126 | ||
127 | f = JFFS2_INODE_INFO(inode); | 127 | f = JFFS2_INODE_INFO(inode); |
128 | 128 | ||
diff --git a/fs/jfs/ioctl.c b/fs/jfs/ioctl.c index bc555ff417e9..93a1232894f6 100644 --- a/fs/jfs/ioctl.c +++ b/fs/jfs/ioctl.c | |||
@@ -58,7 +58,7 @@ static long jfs_map_ext2(unsigned long flags, int from) | |||
58 | 58 | ||
59 | long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 59 | long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
60 | { | 60 | { |
61 | struct inode *inode = filp->f_dentry->d_inode; | 61 | struct inode *inode = file_inode(filp); |
62 | struct jfs_inode_info *jfs_inode = JFS_IP(inode); | 62 | struct jfs_inode_info *jfs_inode = JFS_IP(inode); |
63 | unsigned int flags; | 63 | unsigned int flags; |
64 | 64 | ||
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c index 9197a1b0d02d..0ddbeceafc62 100644 --- a/fs/jfs/jfs_dtree.c +++ b/fs/jfs/jfs_dtree.c | |||
@@ -3004,7 +3004,7 @@ static inline struct jfs_dirent *next_jfs_dirent(struct jfs_dirent *dirent) | |||
3004 | */ | 3004 | */ |
3005 | int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | 3005 | int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir) |
3006 | { | 3006 | { |
3007 | struct inode *ip = filp->f_path.dentry->d_inode; | 3007 | struct inode *ip = file_inode(filp); |
3008 | struct nls_table *codepage = JFS_SBI(ip->i_sb)->nls_tab; | 3008 | struct nls_table *codepage = JFS_SBI(ip->i_sb)->nls_tab; |
3009 | int rc = 0; | 3009 | int rc = 0; |
3010 | loff_t dtpos; /* legacy OS/2 style position */ | 3010 | loff_t dtpos; /* legacy OS/2 style position */ |
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c index ca0a08001449..a2717408c478 100644 --- a/fs/lockd/clntlock.c +++ b/fs/lockd/clntlock.c | |||
@@ -178,7 +178,7 @@ __be32 nlmclnt_grant(const struct sockaddr *addr, const struct nlm_lock *lock) | |||
178 | continue; | 178 | continue; |
179 | if (!rpc_cmp_addr(nlm_addr(block->b_host), addr)) | 179 | if (!rpc_cmp_addr(nlm_addr(block->b_host), addr)) |
180 | continue; | 180 | continue; |
181 | if (nfs_compare_fh(NFS_FH(fl_blocked->fl_file->f_path.dentry->d_inode) ,fh) != 0) | 181 | if (nfs_compare_fh(NFS_FH(file_inode(fl_blocked->fl_file)) ,fh) != 0) |
182 | continue; | 182 | continue; |
183 | /* Alright, we found a lock. Set the return status | 183 | /* Alright, we found a lock. Set the return status |
184 | * and wake up the caller | 184 | * and wake up the caller |
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index 54f9e6ce0430..d7e1ec1c6827 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c | |||
@@ -127,7 +127,7 @@ static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl) | |||
127 | struct nlm_lock *lock = &argp->lock; | 127 | struct nlm_lock *lock = &argp->lock; |
128 | 128 | ||
129 | nlmclnt_next_cookie(&argp->cookie); | 129 | nlmclnt_next_cookie(&argp->cookie); |
130 | memcpy(&lock->fh, NFS_FH(fl->fl_file->f_path.dentry->d_inode), sizeof(struct nfs_fh)); | 130 | memcpy(&lock->fh, NFS_FH(file_inode(fl->fl_file)), sizeof(struct nfs_fh)); |
131 | lock->caller = utsname()->nodename; | 131 | lock->caller = utsname()->nodename; |
132 | lock->oh.data = req->a_owner; | 132 | lock->oh.data = req->a_owner; |
133 | lock->oh.len = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s", | 133 | lock->oh.len = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s", |
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index 8d80c990dffd..e703318c41df 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c | |||
@@ -406,8 +406,8 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file, | |||
406 | __be32 ret; | 406 | __be32 ret; |
407 | 407 | ||
408 | dprintk("lockd: nlmsvc_lock(%s/%ld, ty=%d, pi=%d, %Ld-%Ld, bl=%d)\n", | 408 | dprintk("lockd: nlmsvc_lock(%s/%ld, ty=%d, pi=%d, %Ld-%Ld, bl=%d)\n", |
409 | file->f_file->f_path.dentry->d_inode->i_sb->s_id, | 409 | file_inode(file->f_file)->i_sb->s_id, |
410 | file->f_file->f_path.dentry->d_inode->i_ino, | 410 | file_inode(file->f_file)->i_ino, |
411 | lock->fl.fl_type, lock->fl.fl_pid, | 411 | lock->fl.fl_type, lock->fl.fl_pid, |
412 | (long long)lock->fl.fl_start, | 412 | (long long)lock->fl.fl_start, |
413 | (long long)lock->fl.fl_end, | 413 | (long long)lock->fl.fl_end, |
@@ -513,8 +513,8 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file, | |||
513 | __be32 ret; | 513 | __be32 ret; |
514 | 514 | ||
515 | dprintk("lockd: nlmsvc_testlock(%s/%ld, ty=%d, %Ld-%Ld)\n", | 515 | dprintk("lockd: nlmsvc_testlock(%s/%ld, ty=%d, %Ld-%Ld)\n", |
516 | file->f_file->f_path.dentry->d_inode->i_sb->s_id, | 516 | file_inode(file->f_file)->i_sb->s_id, |
517 | file->f_file->f_path.dentry->d_inode->i_ino, | 517 | file_inode(file->f_file)->i_ino, |
518 | lock->fl.fl_type, | 518 | lock->fl.fl_type, |
519 | (long long)lock->fl.fl_start, | 519 | (long long)lock->fl.fl_start, |
520 | (long long)lock->fl.fl_end); | 520 | (long long)lock->fl.fl_end); |
@@ -606,8 +606,8 @@ nlmsvc_unlock(struct net *net, struct nlm_file *file, struct nlm_lock *lock) | |||
606 | int error; | 606 | int error; |
607 | 607 | ||
608 | dprintk("lockd: nlmsvc_unlock(%s/%ld, pi=%d, %Ld-%Ld)\n", | 608 | dprintk("lockd: nlmsvc_unlock(%s/%ld, pi=%d, %Ld-%Ld)\n", |
609 | file->f_file->f_path.dentry->d_inode->i_sb->s_id, | 609 | file_inode(file->f_file)->i_sb->s_id, |
610 | file->f_file->f_path.dentry->d_inode->i_ino, | 610 | file_inode(file->f_file)->i_ino, |
611 | lock->fl.fl_pid, | 611 | lock->fl.fl_pid, |
612 | (long long)lock->fl.fl_start, | 612 | (long long)lock->fl.fl_start, |
613 | (long long)lock->fl.fl_end); | 613 | (long long)lock->fl.fl_end); |
@@ -635,8 +635,8 @@ nlmsvc_cancel_blocked(struct net *net, struct nlm_file *file, struct nlm_lock *l | |||
635 | int status = 0; | 635 | int status = 0; |
636 | 636 | ||
637 | dprintk("lockd: nlmsvc_cancel(%s/%ld, pi=%d, %Ld-%Ld)\n", | 637 | dprintk("lockd: nlmsvc_cancel(%s/%ld, pi=%d, %Ld-%Ld)\n", |
638 | file->f_file->f_path.dentry->d_inode->i_sb->s_id, | 638 | file_inode(file->f_file)->i_sb->s_id, |
639 | file->f_file->f_path.dentry->d_inode->i_ino, | 639 | file_inode(file->f_file)->i_ino, |
640 | lock->fl.fl_pid, | 640 | lock->fl.fl_pid, |
641 | (long long)lock->fl.fl_start, | 641 | (long long)lock->fl.fl_start, |
642 | (long long)lock->fl.fl_end); | 642 | (long long)lock->fl.fl_end); |
diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c index 0deb5f6c9dd4..b3a24b07d981 100644 --- a/fs/lockd/svcsubs.c +++ b/fs/lockd/svcsubs.c | |||
@@ -45,7 +45,7 @@ static inline void nlm_debug_print_fh(char *msg, struct nfs_fh *f) | |||
45 | 45 | ||
46 | static inline void nlm_debug_print_file(char *msg, struct nlm_file *file) | 46 | static inline void nlm_debug_print_file(char *msg, struct nlm_file *file) |
47 | { | 47 | { |
48 | struct inode *inode = file->f_file->f_path.dentry->d_inode; | 48 | struct inode *inode = file_inode(file->f_file); |
49 | 49 | ||
50 | dprintk("lockd: %s %s/%ld\n", | 50 | dprintk("lockd: %s %s/%ld\n", |
51 | msg, inode->i_sb->s_id, inode->i_ino); | 51 | msg, inode->i_sb->s_id, inode->i_ino); |
diff --git a/fs/locks.c b/fs/locks.c index a94e331a52a2..cb424a4fed71 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -334,7 +334,7 @@ static int flock_to_posix_lock(struct file *filp, struct file_lock *fl, | |||
334 | start = filp->f_pos; | 334 | start = filp->f_pos; |
335 | break; | 335 | break; |
336 | case SEEK_END: | 336 | case SEEK_END: |
337 | start = i_size_read(filp->f_path.dentry->d_inode); | 337 | start = i_size_read(file_inode(filp)); |
338 | break; | 338 | break; |
339 | default: | 339 | default: |
340 | return -EINVAL; | 340 | return -EINVAL; |
@@ -384,7 +384,7 @@ static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl, | |||
384 | start = filp->f_pos; | 384 | start = filp->f_pos; |
385 | break; | 385 | break; |
386 | case SEEK_END: | 386 | case SEEK_END: |
387 | start = i_size_read(filp->f_path.dentry->d_inode); | 387 | start = i_size_read(file_inode(filp)); |
388 | break; | 388 | break; |
389 | default: | 389 | default: |
390 | return -EINVAL; | 390 | return -EINVAL; |
@@ -627,7 +627,7 @@ posix_test_lock(struct file *filp, struct file_lock *fl) | |||
627 | struct file_lock *cfl; | 627 | struct file_lock *cfl; |
628 | 628 | ||
629 | lock_flocks(); | 629 | lock_flocks(); |
630 | for (cfl = filp->f_path.dentry->d_inode->i_flock; cfl; cfl = cfl->fl_next) { | 630 | for (cfl = file_inode(filp)->i_flock; cfl; cfl = cfl->fl_next) { |
631 | if (!IS_POSIX(cfl)) | 631 | if (!IS_POSIX(cfl)) |
632 | continue; | 632 | continue; |
633 | if (posix_locks_conflict(fl, cfl)) | 633 | if (posix_locks_conflict(fl, cfl)) |
@@ -708,7 +708,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) | |||
708 | { | 708 | { |
709 | struct file_lock *new_fl = NULL; | 709 | struct file_lock *new_fl = NULL; |
710 | struct file_lock **before; | 710 | struct file_lock **before; |
711 | struct inode * inode = filp->f_path.dentry->d_inode; | 711 | struct inode * inode = file_inode(filp); |
712 | int error = 0; | 712 | int error = 0; |
713 | int found = 0; | 713 | int found = 0; |
714 | 714 | ||
@@ -1002,7 +1002,7 @@ static int __posix_lock_file(struct inode *inode, struct file_lock *request, str | |||
1002 | int posix_lock_file(struct file *filp, struct file_lock *fl, | 1002 | int posix_lock_file(struct file *filp, struct file_lock *fl, |
1003 | struct file_lock *conflock) | 1003 | struct file_lock *conflock) |
1004 | { | 1004 | { |
1005 | return __posix_lock_file(filp->f_path.dentry->d_inode, fl, conflock); | 1005 | return __posix_lock_file(file_inode(filp), fl, conflock); |
1006 | } | 1006 | } |
1007 | EXPORT_SYMBOL(posix_lock_file); | 1007 | EXPORT_SYMBOL(posix_lock_file); |
1008 | 1008 | ||
@@ -1326,8 +1326,8 @@ int fcntl_getlease(struct file *filp) | |||
1326 | int type = F_UNLCK; | 1326 | int type = F_UNLCK; |
1327 | 1327 | ||
1328 | lock_flocks(); | 1328 | lock_flocks(); |
1329 | time_out_leases(filp->f_path.dentry->d_inode); | 1329 | time_out_leases(file_inode(filp)); |
1330 | for (fl = filp->f_path.dentry->d_inode->i_flock; fl && IS_LEASE(fl); | 1330 | for (fl = file_inode(filp)->i_flock; fl && IS_LEASE(fl); |
1331 | fl = fl->fl_next) { | 1331 | fl = fl->fl_next) { |
1332 | if (fl->fl_file == filp) { | 1332 | if (fl->fl_file == filp) { |
1333 | type = target_leasetype(fl); | 1333 | type = target_leasetype(fl); |
@@ -1843,7 +1843,7 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd, | |||
1843 | if (copy_from_user(&flock, l, sizeof(flock))) | 1843 | if (copy_from_user(&flock, l, sizeof(flock))) |
1844 | goto out; | 1844 | goto out; |
1845 | 1845 | ||
1846 | inode = filp->f_path.dentry->d_inode; | 1846 | inode = file_inode(filp); |
1847 | 1847 | ||
1848 | /* Don't allow mandatory locks on files that may be memory mapped | 1848 | /* Don't allow mandatory locks on files that may be memory mapped |
1849 | * and shared. | 1849 | * and shared. |
@@ -1961,7 +1961,7 @@ int fcntl_setlk64(unsigned int fd, struct file *filp, unsigned int cmd, | |||
1961 | if (copy_from_user(&flock, l, sizeof(flock))) | 1961 | if (copy_from_user(&flock, l, sizeof(flock))) |
1962 | goto out; | 1962 | goto out; |
1963 | 1963 | ||
1964 | inode = filp->f_path.dentry->d_inode; | 1964 | inode = file_inode(filp); |
1965 | 1965 | ||
1966 | /* Don't allow mandatory locks on files that may be memory mapped | 1966 | /* Don't allow mandatory locks on files that may be memory mapped |
1967 | * and shared. | 1967 | * and shared. |
@@ -2030,7 +2030,7 @@ void locks_remove_posix(struct file *filp, fl_owner_t owner) | |||
2030 | * posix_lock_file(). Another process could be setting a lock on this | 2030 | * posix_lock_file(). Another process could be setting a lock on this |
2031 | * file at the same time, but we wouldn't remove that lock anyway. | 2031 | * file at the same time, but we wouldn't remove that lock anyway. |
2032 | */ | 2032 | */ |
2033 | if (!filp->f_path.dentry->d_inode->i_flock) | 2033 | if (!file_inode(filp)->i_flock) |
2034 | return; | 2034 | return; |
2035 | 2035 | ||
2036 | lock.fl_type = F_UNLCK; | 2036 | lock.fl_type = F_UNLCK; |
@@ -2056,7 +2056,7 @@ EXPORT_SYMBOL(locks_remove_posix); | |||
2056 | */ | 2056 | */ |
2057 | void locks_remove_flock(struct file *filp) | 2057 | void locks_remove_flock(struct file *filp) |
2058 | { | 2058 | { |
2059 | struct inode * inode = filp->f_path.dentry->d_inode; | 2059 | struct inode * inode = file_inode(filp); |
2060 | struct file_lock *fl; | 2060 | struct file_lock *fl; |
2061 | struct file_lock **before; | 2061 | struct file_lock **before; |
2062 | 2062 | ||
@@ -2152,7 +2152,7 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl, | |||
2152 | fl_pid = fl->fl_pid; | 2152 | fl_pid = fl->fl_pid; |
2153 | 2153 | ||
2154 | if (fl->fl_file != NULL) | 2154 | if (fl->fl_file != NULL) |
2155 | inode = fl->fl_file->f_path.dentry->d_inode; | 2155 | inode = file_inode(fl->fl_file); |
2156 | 2156 | ||
2157 | seq_printf(f, "%lld:%s ", id, pfx); | 2157 | seq_printf(f, "%lld:%s ", id, pfx); |
2158 | if (IS_POSIX(fl)) { | 2158 | if (IS_POSIX(fl)) { |
diff --git a/fs/logfs/dir.c b/fs/logfs/dir.c index 26e4a941532f..b82751082112 100644 --- a/fs/logfs/dir.c +++ b/fs/logfs/dir.c | |||
@@ -284,7 +284,7 @@ static int logfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
284 | #define IMPLICIT_NODES 2 | 284 | #define IMPLICIT_NODES 2 |
285 | static int __logfs_readdir(struct file *file, void *buf, filldir_t filldir) | 285 | static int __logfs_readdir(struct file *file, void *buf, filldir_t filldir) |
286 | { | 286 | { |
287 | struct inode *dir = file->f_dentry->d_inode; | 287 | struct inode *dir = file_inode(file); |
288 | loff_t pos = file->f_pos - IMPLICIT_NODES; | 288 | loff_t pos = file->f_pos - IMPLICIT_NODES; |
289 | struct page *page; | 289 | struct page *page; |
290 | struct logfs_disk_dentry *dd; | 290 | struct logfs_disk_dentry *dd; |
@@ -320,7 +320,7 @@ static int __logfs_readdir(struct file *file, void *buf, filldir_t filldir) | |||
320 | 320 | ||
321 | static int logfs_readdir(struct file *file, void *buf, filldir_t filldir) | 321 | static int logfs_readdir(struct file *file, void *buf, filldir_t filldir) |
322 | { | 322 | { |
323 | struct inode *inode = file->f_dentry->d_inode; | 323 | struct inode *inode = file_inode(file); |
324 | ino_t pino = parent_ino(file->f_dentry); | 324 | ino_t pino = parent_ino(file->f_dentry); |
325 | int err; | 325 | int err; |
326 | 326 | ||
diff --git a/fs/logfs/file.c b/fs/logfs/file.c index 3886cded283c..c2219a6dd3c8 100644 --- a/fs/logfs/file.c +++ b/fs/logfs/file.c | |||
@@ -183,7 +183,7 @@ static int logfs_releasepage(struct page *page, gfp_t only_xfs_uses_this) | |||
183 | 183 | ||
184 | long logfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 184 | long logfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
185 | { | 185 | { |
186 | struct inode *inode = file->f_path.dentry->d_inode; | 186 | struct inode *inode = file_inode(file); |
187 | struct logfs_inode *li = logfs_inode(inode); | 187 | struct logfs_inode *li = logfs_inode(inode); |
188 | unsigned int oldflags, flags; | 188 | unsigned int oldflags, flags; |
189 | int err; | 189 | int err; |
diff --git a/fs/minix/dir.c b/fs/minix/dir.c index 685b2d981b87..a9ed6f36e6ea 100644 --- a/fs/minix/dir.c +++ b/fs/minix/dir.c | |||
@@ -85,7 +85,7 @@ static inline void *minix_next_entry(void *de, struct minix_sb_info *sbi) | |||
85 | static int minix_readdir(struct file * filp, void * dirent, filldir_t filldir) | 85 | static int minix_readdir(struct file * filp, void * dirent, filldir_t filldir) |
86 | { | 86 | { |
87 | unsigned long pos = filp->f_pos; | 87 | unsigned long pos = filp->f_pos; |
88 | struct inode *inode = filp->f_path.dentry->d_inode; | 88 | struct inode *inode = file_inode(filp); |
89 | struct super_block *sb = inode->i_sb; | 89 | struct super_block *sb = inode->i_sb; |
90 | unsigned offset = pos & ~PAGE_CACHE_MASK; | 90 | unsigned offset = pos & ~PAGE_CACHE_MASK; |
91 | unsigned long n = pos >> PAGE_CACHE_SHIFT; | 91 | unsigned long n = pos >> PAGE_CACHE_SHIFT; |
diff --git a/fs/namei.c b/fs/namei.c index 43a97ee1d4c8..df00b754631d 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2778,7 +2778,7 @@ retry_lookup: | |||
2778 | goto out; | 2778 | goto out; |
2779 | 2779 | ||
2780 | if ((*opened & FILE_CREATED) || | 2780 | if ((*opened & FILE_CREATED) || |
2781 | !S_ISREG(file->f_path.dentry->d_inode->i_mode)) | 2781 | !S_ISREG(file_inode(file)->i_mode)) |
2782 | will_truncate = false; | 2782 | will_truncate = false; |
2783 | 2783 | ||
2784 | audit_inode(name, file->f_path.dentry, 0); | 2784 | audit_inode(name, file->f_path.dentry, 0); |
diff --git a/fs/namespace.c b/fs/namespace.c index 269919fa116d..50ca17d3cb45 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -384,7 +384,7 @@ EXPORT_SYMBOL_GPL(mnt_clone_write); | |||
384 | */ | 384 | */ |
385 | int __mnt_want_write_file(struct file *file) | 385 | int __mnt_want_write_file(struct file *file) |
386 | { | 386 | { |
387 | struct inode *inode = file->f_dentry->d_inode; | 387 | struct inode *inode = file_inode(file); |
388 | 388 | ||
389 | if (!(file->f_mode & FMODE_WRITE) || special_file(inode->i_mode)) | 389 | if (!(file->f_mode & FMODE_WRITE) || special_file(inode->i_mode)) |
390 | return __mnt_want_write(file->f_path.mnt); | 390 | return __mnt_want_write(file->f_path.mnt); |
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index 1acdad7fcec7..c41e02932542 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c | |||
@@ -525,7 +525,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) | |||
525 | if (!ncp_filp) | 525 | if (!ncp_filp) |
526 | goto out; | 526 | goto out; |
527 | error = -ENOTSOCK; | 527 | error = -ENOTSOCK; |
528 | sock_inode = ncp_filp->f_path.dentry->d_inode; | 528 | sock_inode = file_inode(ncp_filp); |
529 | if (!S_ISSOCK(sock_inode->i_mode)) | 529 | if (!S_ISSOCK(sock_inode->i_mode)) |
530 | goto out_fput; | 530 | goto out_fput; |
531 | sock = SOCKET_I(sock_inode); | 531 | sock = SOCKET_I(sock_inode); |
@@ -564,7 +564,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) | |||
564 | if (!server->info_filp) | 564 | if (!server->info_filp) |
565 | goto out_bdi; | 565 | goto out_bdi; |
566 | error = -ENOTSOCK; | 566 | error = -ENOTSOCK; |
567 | sock_inode = server->info_filp->f_path.dentry->d_inode; | 567 | sock_inode = file_inode(server->info_filp); |
568 | if (!S_ISSOCK(sock_inode->i_mode)) | 568 | if (!S_ISSOCK(sock_inode->i_mode)) |
569 | goto out_fput2; | 569 | goto out_fput2; |
570 | info_sock = SOCKET_I(sock_inode); | 570 | info_sock = SOCKET_I(sock_inode); |
diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c index 6958adfaff08..5c1e9262219c 100644 --- a/fs/ncpfs/ioctl.c +++ b/fs/ncpfs/ioctl.c | |||
@@ -808,7 +808,7 @@ outrel: | |||
808 | 808 | ||
809 | long ncp_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 809 | long ncp_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
810 | { | 810 | { |
811 | struct inode *inode = filp->f_dentry->d_inode; | 811 | struct inode *inode = file_inode(filp); |
812 | struct ncp_server *server = NCP_SERVER(inode); | 812 | struct ncp_server *server = NCP_SERVER(inode); |
813 | uid_t uid = current_uid(); | 813 | uid_t uid = current_uid(); |
814 | int need_drop_write = 0; | 814 | int need_drop_write = 0; |
diff --git a/fs/ncpfs/mmap.c b/fs/ncpfs/mmap.c index 63d14a99483d..ee24df5af1f9 100644 --- a/fs/ncpfs/mmap.c +++ b/fs/ncpfs/mmap.c | |||
@@ -105,7 +105,7 @@ static const struct vm_operations_struct ncp_file_mmap = | |||
105 | /* This is used for a general mmap of a ncp file */ | 105 | /* This is used for a general mmap of a ncp file */ |
106 | int ncp_mmap(struct file *file, struct vm_area_struct *vma) | 106 | int ncp_mmap(struct file *file, struct vm_area_struct *vma) |
107 | { | 107 | { |
108 | struct inode *inode = file->f_path.dentry->d_inode; | 108 | struct inode *inode = file_inode(file); |
109 | 109 | ||
110 | DPRINTK("ncp_mmap: called\n"); | 110 | DPRINTK("ncp_mmap: called\n"); |
111 | 111 | ||
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 1b2d7eb93796..a8bd28cde7e2 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -281,7 +281,7 @@ int nfs_readdir_search_for_cookie(struct nfs_cache_array *array, nfs_readdir_des | |||
281 | 281 | ||
282 | for (i = 0; i < array->size; i++) { | 282 | for (i = 0; i < array->size; i++) { |
283 | if (array->array[i].cookie == *desc->dir_cookie) { | 283 | if (array->array[i].cookie == *desc->dir_cookie) { |
284 | struct nfs_inode *nfsi = NFS_I(desc->file->f_path.dentry->d_inode); | 284 | struct nfs_inode *nfsi = NFS_I(file_inode(desc->file)); |
285 | struct nfs_open_dir_context *ctx = desc->file->private_data; | 285 | struct nfs_open_dir_context *ctx = desc->file->private_data; |
286 | 286 | ||
287 | new_pos = desc->current_index + i; | 287 | new_pos = desc->current_index + i; |
@@ -629,7 +629,7 @@ out: | |||
629 | static | 629 | static |
630 | int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page* page) | 630 | int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page* page) |
631 | { | 631 | { |
632 | struct inode *inode = desc->file->f_path.dentry->d_inode; | 632 | struct inode *inode = file_inode(desc->file); |
633 | int ret; | 633 | int ret; |
634 | 634 | ||
635 | ret = nfs_readdir_xdr_to_array(desc, page, inode); | 635 | ret = nfs_readdir_xdr_to_array(desc, page, inode); |
@@ -660,7 +660,7 @@ void cache_page_release(nfs_readdir_descriptor_t *desc) | |||
660 | static | 660 | static |
661 | struct page *get_cache_page(nfs_readdir_descriptor_t *desc) | 661 | struct page *get_cache_page(nfs_readdir_descriptor_t *desc) |
662 | { | 662 | { |
663 | return read_cache_page(desc->file->f_path.dentry->d_inode->i_mapping, | 663 | return read_cache_page(file_inode(desc->file)->i_mapping, |
664 | desc->page_index, (filler_t *)nfs_readdir_filler, desc); | 664 | desc->page_index, (filler_t *)nfs_readdir_filler, desc); |
665 | } | 665 | } |
666 | 666 | ||
@@ -764,7 +764,7 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc, void *dirent, | |||
764 | { | 764 | { |
765 | struct page *page = NULL; | 765 | struct page *page = NULL; |
766 | int status; | 766 | int status; |
767 | struct inode *inode = desc->file->f_path.dentry->d_inode; | 767 | struct inode *inode = file_inode(desc->file); |
768 | struct nfs_open_dir_context *ctx = desc->file->private_data; | 768 | struct nfs_open_dir_context *ctx = desc->file->private_data; |
769 | 769 | ||
770 | dfprintk(DIRCACHE, "NFS: uncached_readdir() searching for cookie %Lu\n", | 770 | dfprintk(DIRCACHE, "NFS: uncached_readdir() searching for cookie %Lu\n", |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 3c2b893665ba..29f4a48a0ee6 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -292,7 +292,7 @@ static int | |||
292 | nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) | 292 | nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) |
293 | { | 293 | { |
294 | int ret; | 294 | int ret; |
295 | struct inode *inode = file->f_path.dentry->d_inode; | 295 | struct inode *inode = file_inode(file); |
296 | 296 | ||
297 | do { | 297 | do { |
298 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); | 298 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); |
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c index bc3968fa81e5..2ad8deaf7dbf 100644 --- a/fs/nfs/idmap.c +++ b/fs/nfs/idmap.c | |||
@@ -764,7 +764,7 @@ out: | |||
764 | static ssize_t | 764 | static ssize_t |
765 | idmap_pipe_downcall(struct file *filp, const char __user *src, size_t mlen) | 765 | idmap_pipe_downcall(struct file *filp, const char __user *src, size_t mlen) |
766 | { | 766 | { |
767 | struct rpc_inode *rpci = RPC_I(filp->f_path.dentry->d_inode); | 767 | struct rpc_inode *rpci = RPC_I(file_inode(filp)); |
768 | struct idmap *idmap = (struct idmap *)rpci->private; | 768 | struct idmap *idmap = (struct idmap *)rpci->private; |
769 | struct key_construction *cons; | 769 | struct key_construction *cons; |
770 | struct idmap_msg im; | 770 | struct idmap_msg im; |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index ebeb94ce1b0b..548ae3113005 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -714,7 +714,7 @@ EXPORT_SYMBOL_GPL(put_nfs_open_context); | |||
714 | */ | 714 | */ |
715 | void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx) | 715 | void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx) |
716 | { | 716 | { |
717 | struct inode *inode = filp->f_path.dentry->d_inode; | 717 | struct inode *inode = file_inode(filp); |
718 | struct nfs_inode *nfsi = NFS_I(inode); | 718 | struct nfs_inode *nfsi = NFS_I(inode); |
719 | 719 | ||
720 | filp->private_data = get_nfs_open_context(ctx); | 720 | filp->private_data = get_nfs_open_context(ctx); |
@@ -747,7 +747,7 @@ struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_c | |||
747 | 747 | ||
748 | static void nfs_file_clear_open_context(struct file *filp) | 748 | static void nfs_file_clear_open_context(struct file *filp) |
749 | { | 749 | { |
750 | struct inode *inode = filp->f_path.dentry->d_inode; | 750 | struct inode *inode = file_inode(filp); |
751 | struct nfs_open_context *ctx = nfs_file_open_context(filp); | 751 | struct nfs_open_context *ctx = nfs_file_open_context(filp); |
752 | 752 | ||
753 | if (ctx) { | 753 | if (ctx) { |
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 70efb63b1e42..43ea96ced28c 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
@@ -872,7 +872,7 @@ static void nfs3_proc_commit_setup(struct nfs_commit_data *data, struct rpc_mess | |||
872 | static int | 872 | static int |
873 | nfs3_proc_lock(struct file *filp, int cmd, struct file_lock *fl) | 873 | nfs3_proc_lock(struct file *filp, int cmd, struct file_lock *fl) |
874 | { | 874 | { |
875 | struct inode *inode = filp->f_path.dentry->d_inode; | 875 | struct inode *inode = file_inode(filp); |
876 | 876 | ||
877 | return nlmclnt_proc(NFS_SERVER(inode)->nlm_host, cmd, fl); | 877 | return nlmclnt_proc(NFS_SERVER(inode)->nlm_host, cmd, fl); |
878 | } | 878 | } |
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index 08ddcccb8887..13e6bb3e3fe5 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c | |||
@@ -94,7 +94,7 @@ static int | |||
94 | nfs4_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) | 94 | nfs4_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) |
95 | { | 95 | { |
96 | int ret; | 96 | int ret; |
97 | struct inode *inode = file->f_path.dentry->d_inode; | 97 | struct inode *inode = file_inode(file); |
98 | 98 | ||
99 | do { | 99 | do { |
100 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); | 100 | ret = filemap_write_and_wait_range(inode->i_mapping, start, end); |
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index f084dac948e1..fc8de9016acf 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c | |||
@@ -662,7 +662,7 @@ nfs_proc_commit_setup(struct nfs_commit_data *data, struct rpc_message *msg) | |||
662 | static int | 662 | static int |
663 | nfs_proc_lock(struct file *filp, int cmd, struct file_lock *fl) | 663 | nfs_proc_lock(struct file *filp, int cmd, struct file_lock *fl) |
664 | { | 664 | { |
665 | struct inode *inode = filp->f_path.dentry->d_inode; | 665 | struct inode *inode = file_inode(filp); |
666 | 666 | ||
667 | return nlmclnt_proc(NFS_SERVER(inode)->nlm_host, cmd, fl); | 667 | return nlmclnt_proc(NFS_SERVER(inode)->nlm_host, cmd, fl); |
668 | } | 668 | } |
diff --git a/fs/nfsd/fault_inject.c b/fs/nfsd/fault_inject.c index e761ee95617f..497584c70366 100644 --- a/fs/nfsd/fault_inject.c +++ b/fs/nfsd/fault_inject.c | |||
@@ -101,7 +101,7 @@ static ssize_t fault_inject_read(struct file *file, char __user *buf, | |||
101 | loff_t pos = *ppos; | 101 | loff_t pos = *ppos; |
102 | 102 | ||
103 | if (!pos) | 103 | if (!pos) |
104 | nfsd_inject_get(file->f_dentry->d_inode->i_private, &val); | 104 | nfsd_inject_get(file_inode(file)->i_private, &val); |
105 | size = scnprintf(read_buf, sizeof(read_buf), "%llu\n", val); | 105 | size = scnprintf(read_buf, sizeof(read_buf), "%llu\n", val); |
106 | 106 | ||
107 | if (pos < 0) | 107 | if (pos < 0) |
@@ -133,10 +133,10 @@ static ssize_t fault_inject_write(struct file *file, const char __user *buf, | |||
133 | 133 | ||
134 | size = rpc_pton(net, write_buf, size, (struct sockaddr *)&sa, sizeof(sa)); | 134 | size = rpc_pton(net, write_buf, size, (struct sockaddr *)&sa, sizeof(sa)); |
135 | if (size > 0) | 135 | if (size > 0) |
136 | nfsd_inject_set_client(file->f_dentry->d_inode->i_private, &sa, size); | 136 | nfsd_inject_set_client(file_inode(file)->i_private, &sa, size); |
137 | else { | 137 | else { |
138 | val = simple_strtoll(write_buf, NULL, 0); | 138 | val = simple_strtoll(write_buf, NULL, 0); |
139 | nfsd_inject_set(file->f_dentry->d_inode->i_private, val); | 139 | nfsd_inject_set(file_inode(file)->i_private, val); |
140 | } | 140 | } |
141 | return len; /* on success, claim we got the whole input */ | 141 | return len; /* on success, claim we got the whole input */ |
142 | } | 142 | } |
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 74934284d9a7..2db7021b01ae 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -85,7 +85,7 @@ static ssize_t (*write_op[])(struct file *, char *, size_t) = { | |||
85 | 85 | ||
86 | static ssize_t nfsctl_transaction_write(struct file *file, const char __user *buf, size_t size, loff_t *pos) | 86 | static ssize_t nfsctl_transaction_write(struct file *file, const char __user *buf, size_t size, loff_t *pos) |
87 | { | 87 | { |
88 | ino_t ino = file->f_path.dentry->d_inode->i_ino; | 88 | ino_t ino = file_inode(file)->i_ino; |
89 | char *data; | 89 | char *data; |
90 | ssize_t rv; | 90 | ssize_t rv; |
91 | 91 | ||
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index d586117fa94a..a94245b4045f 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -979,7 +979,7 @@ static void kill_suid(struct dentry *dentry) | |||
979 | */ | 979 | */ |
980 | static int wait_for_concurrent_writes(struct file *file) | 980 | static int wait_for_concurrent_writes(struct file *file) |
981 | { | 981 | { |
982 | struct inode *inode = file->f_path.dentry->d_inode; | 982 | struct inode *inode = file_inode(file); |
983 | static ino_t last_ino; | 983 | static ino_t last_ino; |
984 | static dev_t last_dev; | 984 | static dev_t last_dev; |
985 | int err = 0; | 985 | int err = 0; |
@@ -1070,7 +1070,7 @@ __be32 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1070 | if (err) | 1070 | if (err) |
1071 | return err; | 1071 | return err; |
1072 | 1072 | ||
1073 | inode = file->f_path.dentry->d_inode; | 1073 | inode = file_inode(file); |
1074 | 1074 | ||
1075 | /* Get readahead parameters */ | 1075 | /* Get readahead parameters */ |
1076 | ra = nfsd_get_raparms(inode->i_sb->s_dev, inode->i_ino); | 1076 | ra = nfsd_get_raparms(inode->i_sb->s_dev, inode->i_ino); |
@@ -1957,7 +1957,7 @@ static __be32 nfsd_buffered_readdir(struct file *file, filldir_t func, | |||
1957 | offset = *offsetp; | 1957 | offset = *offsetp; |
1958 | 1958 | ||
1959 | while (1) { | 1959 | while (1) { |
1960 | struct inode *dir_inode = file->f_path.dentry->d_inode; | 1960 | struct inode *dir_inode = file_inode(file); |
1961 | unsigned int reclen; | 1961 | unsigned int reclen; |
1962 | 1962 | ||
1963 | cdp->err = nfserr_eof; /* will be cleared on successful read */ | 1963 | cdp->err = nfserr_eof; /* will be cleared on successful read */ |
diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c index df1a7fb238d1..f30b017740a7 100644 --- a/fs/nilfs2/dir.c +++ b/fs/nilfs2/dir.c | |||
@@ -259,7 +259,7 @@ static void nilfs_set_de_type(struct nilfs_dir_entry *de, struct inode *inode) | |||
259 | static int nilfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | 259 | static int nilfs_readdir(struct file *filp, void *dirent, filldir_t filldir) |
260 | { | 260 | { |
261 | loff_t pos = filp->f_pos; | 261 | loff_t pos = filp->f_pos; |
262 | struct inode *inode = filp->f_dentry->d_inode; | 262 | struct inode *inode = file_inode(filp); |
263 | struct super_block *sb = inode->i_sb; | 263 | struct super_block *sb = inode->i_sb; |
264 | unsigned int offset = pos & ~PAGE_CACHE_MASK; | 264 | unsigned int offset = pos & ~PAGE_CACHE_MASK; |
265 | unsigned long n = pos >> PAGE_CACHE_SHIFT; | 265 | unsigned long n = pos >> PAGE_CACHE_SHIFT; |
diff --git a/fs/nilfs2/file.c b/fs/nilfs2/file.c index 61946883025c..89dc0886387d 100644 --- a/fs/nilfs2/file.c +++ b/fs/nilfs2/file.c | |||
@@ -67,7 +67,7 @@ int nilfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) | |||
67 | static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | 67 | static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) |
68 | { | 68 | { |
69 | struct page *page = vmf->page; | 69 | struct page *page = vmf->page; |
70 | struct inode *inode = vma->vm_file->f_dentry->d_inode; | 70 | struct inode *inode = file_inode(vma->vm_file); |
71 | struct nilfs_transaction_info ti; | 71 | struct nilfs_transaction_info ti; |
72 | int ret = 0; | 72 | int ret = 0; |
73 | 73 | ||
diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c index fdb180769485..ef61c749641d 100644 --- a/fs/nilfs2/ioctl.c +++ b/fs/nilfs2/ioctl.c | |||
@@ -793,7 +793,7 @@ static int nilfs_ioctl_get_info(struct inode *inode, struct file *filp, | |||
793 | 793 | ||
794 | long nilfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 794 | long nilfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
795 | { | 795 | { |
796 | struct inode *inode = filp->f_dentry->d_inode; | 796 | struct inode *inode = file_inode(filp); |
797 | void __user *argp = (void __user *)arg; | 797 | void __user *argp = (void __user *)arg; |
798 | 798 | ||
799 | switch (cmd) { | 799 | switch (cmd) { |
diff --git a/fs/notify/dnotify/dnotify.c b/fs/notify/dnotify/dnotify.c index 08b886f119ce..2bfe6dc413a0 100644 --- a/fs/notify/dnotify/dnotify.c +++ b/fs/notify/dnotify/dnotify.c | |||
@@ -174,7 +174,7 @@ void dnotify_flush(struct file *filp, fl_owner_t id) | |||
174 | struct dnotify_struct **prev; | 174 | struct dnotify_struct **prev; |
175 | struct inode *inode; | 175 | struct inode *inode; |
176 | 176 | ||
177 | inode = filp->f_path.dentry->d_inode; | 177 | inode = file_inode(filp); |
178 | if (!S_ISDIR(inode->i_mode)) | 178 | if (!S_ISDIR(inode->i_mode)) |
179 | return; | 179 | return; |
180 | 180 | ||
@@ -296,7 +296,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg) | |||
296 | } | 296 | } |
297 | 297 | ||
298 | /* dnotify only works on directories */ | 298 | /* dnotify only works on directories */ |
299 | inode = filp->f_path.dentry->d_inode; | 299 | inode = file_inode(filp); |
300 | if (!S_ISDIR(inode->i_mode)) { | 300 | if (!S_ISDIR(inode->i_mode)) { |
301 | error = -ENOTDIR; | 301 | error = -ENOTDIR; |
302 | goto out_err; | 302 | goto out_err; |
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 9ff4a5ee6e20..5d8444268a16 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c | |||
@@ -466,7 +466,7 @@ static int fanotify_find_path(int dfd, const char __user *filename, | |||
466 | 466 | ||
467 | ret = -ENOTDIR; | 467 | ret = -ENOTDIR; |
468 | if ((flags & FAN_MARK_ONLYDIR) && | 468 | if ((flags & FAN_MARK_ONLYDIR) && |
469 | !(S_ISDIR(f.file->f_path.dentry->d_inode->i_mode))) { | 469 | !(S_ISDIR(file_inode(f.file)->i_mode))) { |
470 | fdput(f); | 470 | fdput(f); |
471 | goto out; | 471 | goto out; |
472 | } | 472 | } |
diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c index 99e36107ff60..aa411c3f20e9 100644 --- a/fs/ntfs/dir.c +++ b/fs/ntfs/dir.c | |||
@@ -1101,7 +1101,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
1101 | { | 1101 | { |
1102 | s64 ia_pos, ia_start, prev_ia_pos, bmp_pos; | 1102 | s64 ia_pos, ia_start, prev_ia_pos, bmp_pos; |
1103 | loff_t fpos, i_size; | 1103 | loff_t fpos, i_size; |
1104 | struct inode *bmp_vi, *vdir = filp->f_path.dentry->d_inode; | 1104 | struct inode *bmp_vi, *vdir = file_inode(filp); |
1105 | struct super_block *sb = vdir->i_sb; | 1105 | struct super_block *sb = vdir->i_sb; |
1106 | ntfs_inode *ndir = NTFS_I(vdir); | 1106 | ntfs_inode *ndir = NTFS_I(vdir); |
1107 | ntfs_volume *vol = NTFS_SB(sb); | 1107 | ntfs_volume *vol = NTFS_SB(sb); |
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 657743254eb9..db1ad26e02a7 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -569,7 +569,7 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, | |||
569 | int ret, | 569 | int ret, |
570 | bool is_async) | 570 | bool is_async) |
571 | { | 571 | { |
572 | struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; | 572 | struct inode *inode = file_inode(iocb->ki_filp); |
573 | int level; | 573 | int level; |
574 | wait_queue_head_t *wq = ocfs2_ioend_wq(inode); | 574 | wait_queue_head_t *wq = ocfs2_ioend_wq(inode); |
575 | 575 | ||
@@ -626,7 +626,7 @@ static ssize_t ocfs2_direct_IO(int rw, | |||
626 | unsigned long nr_segs) | 626 | unsigned long nr_segs) |
627 | { | 627 | { |
628 | struct file *file = iocb->ki_filp; | 628 | struct file *file = iocb->ki_filp; |
629 | struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host; | 629 | struct inode *inode = file_inode(file)->i_mapping->host; |
630 | 630 | ||
631 | /* | 631 | /* |
632 | * Fallback to buffered I/O if we see an inode without | 632 | * Fallback to buffered I/O if we see an inode without |
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 8fe4e2892ab9..ac0d4a0e8a41 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
@@ -2015,7 +2015,7 @@ int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv, | |||
2015 | int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir) | 2015 | int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir) |
2016 | { | 2016 | { |
2017 | int error = 0; | 2017 | int error = 0; |
2018 | struct inode *inode = filp->f_path.dentry->d_inode; | 2018 | struct inode *inode = file_inode(filp); |
2019 | int lock_level = 0; | 2019 | int lock_level = 0; |
2020 | 2020 | ||
2021 | trace_ocfs2_readdir((unsigned long long)OCFS2_I(inode)->ip_blkno); | 2021 | trace_ocfs2_readdir((unsigned long long)OCFS2_I(inode)->ip_blkno); |
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c index 16b712d260d4..4c5fc8d77dc2 100644 --- a/fs/ocfs2/dlmfs/dlmfs.c +++ b/fs/ocfs2/dlmfs/dlmfs.c | |||
@@ -224,7 +224,7 @@ static int dlmfs_file_setattr(struct dentry *dentry, struct iattr *attr) | |||
224 | static unsigned int dlmfs_file_poll(struct file *file, poll_table *wait) | 224 | static unsigned int dlmfs_file_poll(struct file *file, poll_table *wait) |
225 | { | 225 | { |
226 | int event = 0; | 226 | int event = 0; |
227 | struct inode *inode = file->f_path.dentry->d_inode; | 227 | struct inode *inode = file_inode(file); |
228 | struct dlmfs_inode_private *ip = DLMFS_I(inode); | 228 | struct dlmfs_inode_private *ip = DLMFS_I(inode); |
229 | 229 | ||
230 | poll_wait(file, &ip->ip_lockres.l_event, wait); | 230 | poll_wait(file, &ip->ip_lockres.l_event, wait); |
@@ -245,7 +245,7 @@ static ssize_t dlmfs_file_read(struct file *filp, | |||
245 | int bytes_left; | 245 | int bytes_left; |
246 | ssize_t readlen, got; | 246 | ssize_t readlen, got; |
247 | char *lvb_buf; | 247 | char *lvb_buf; |
248 | struct inode *inode = filp->f_path.dentry->d_inode; | 248 | struct inode *inode = file_inode(filp); |
249 | 249 | ||
250 | mlog(0, "inode %lu, count = %zu, *ppos = %llu\n", | 250 | mlog(0, "inode %lu, count = %zu, *ppos = %llu\n", |
251 | inode->i_ino, count, *ppos); | 251 | inode->i_ino, count, *ppos); |
@@ -293,7 +293,7 @@ static ssize_t dlmfs_file_write(struct file *filp, | |||
293 | int bytes_left; | 293 | int bytes_left; |
294 | ssize_t writelen; | 294 | ssize_t writelen; |
295 | char *lvb_buf; | 295 | char *lvb_buf; |
296 | struct inode *inode = filp->f_path.dentry->d_inode; | 296 | struct inode *inode = file_inode(filp); |
297 | 297 | ||
298 | mlog(0, "inode %lu, count = %zu, *ppos = %llu\n", | 298 | mlog(0, "inode %lu, count = %zu, *ppos = %llu\n", |
299 | inode->i_ino, count, *ppos); | 299 | inode->i_ino, count, *ppos); |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 37d313ede159..04098af9dbc8 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -1949,7 +1949,7 @@ out: | |||
1949 | int ocfs2_change_file_space(struct file *file, unsigned int cmd, | 1949 | int ocfs2_change_file_space(struct file *file, unsigned int cmd, |
1950 | struct ocfs2_space_resv *sr) | 1950 | struct ocfs2_space_resv *sr) |
1951 | { | 1951 | { |
1952 | struct inode *inode = file->f_path.dentry->d_inode; | 1952 | struct inode *inode = file_inode(file); |
1953 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 1953 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
1954 | int ret; | 1954 | int ret; |
1955 | 1955 | ||
@@ -1977,7 +1977,7 @@ int ocfs2_change_file_space(struct file *file, unsigned int cmd, | |||
1977 | static long ocfs2_fallocate(struct file *file, int mode, loff_t offset, | 1977 | static long ocfs2_fallocate(struct file *file, int mode, loff_t offset, |
1978 | loff_t len) | 1978 | loff_t len) |
1979 | { | 1979 | { |
1980 | struct inode *inode = file->f_path.dentry->d_inode; | 1980 | struct inode *inode = file_inode(file); |
1981 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 1981 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
1982 | struct ocfs2_space_resv sr; | 1982 | struct ocfs2_space_resv sr; |
1983 | int change_size = 1; | 1983 | int change_size = 1; |
@@ -2232,7 +2232,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, | |||
2232 | loff_t old_size, *ppos = &iocb->ki_pos; | 2232 | loff_t old_size, *ppos = &iocb->ki_pos; |
2233 | u32 old_clusters; | 2233 | u32 old_clusters; |
2234 | struct file *file = iocb->ki_filp; | 2234 | struct file *file = iocb->ki_filp; |
2235 | struct inode *inode = file->f_path.dentry->d_inode; | 2235 | struct inode *inode = file_inode(file); |
2236 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 2236 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
2237 | int full_coherency = !(osb->s_mount_opt & | 2237 | int full_coherency = !(osb->s_mount_opt & |
2238 | OCFS2_MOUNT_COHERENCY_BUFFERED); | 2238 | OCFS2_MOUNT_COHERENCY_BUFFERED); |
@@ -2516,7 +2516,7 @@ static ssize_t ocfs2_file_splice_read(struct file *in, | |||
2516 | unsigned int flags) | 2516 | unsigned int flags) |
2517 | { | 2517 | { |
2518 | int ret = 0, lock_level = 0; | 2518 | int ret = 0, lock_level = 0; |
2519 | struct inode *inode = in->f_path.dentry->d_inode; | 2519 | struct inode *inode = file_inode(in); |
2520 | 2520 | ||
2521 | trace_ocfs2_file_splice_read(inode, in, in->f_path.dentry, | 2521 | trace_ocfs2_file_splice_read(inode, in, in->f_path.dentry, |
2522 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | 2522 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
@@ -2546,7 +2546,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, | |||
2546 | { | 2546 | { |
2547 | int ret = 0, rw_level = -1, have_alloc_sem = 0, lock_level = 0; | 2547 | int ret = 0, rw_level = -1, have_alloc_sem = 0, lock_level = 0; |
2548 | struct file *filp = iocb->ki_filp; | 2548 | struct file *filp = iocb->ki_filp; |
2549 | struct inode *inode = filp->f_path.dentry->d_inode; | 2549 | struct inode *inode = file_inode(filp); |
2550 | 2550 | ||
2551 | trace_ocfs2_file_aio_read(inode, filp, filp->f_path.dentry, | 2551 | trace_ocfs2_file_aio_read(inode, filp, filp->f_path.dentry, |
2552 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | 2552 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c index f20edcbfe700..752f0b26221d 100644 --- a/fs/ocfs2/ioctl.c +++ b/fs/ocfs2/ioctl.c | |||
@@ -881,7 +881,7 @@ bail: | |||
881 | 881 | ||
882 | long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 882 | long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
883 | { | 883 | { |
884 | struct inode *inode = filp->f_path.dentry->d_inode; | 884 | struct inode *inode = file_inode(filp); |
885 | unsigned int flags; | 885 | unsigned int flags; |
886 | int new_clusters; | 886 | int new_clusters; |
887 | int status; | 887 | int status; |
@@ -994,7 +994,7 @@ long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg) | |||
994 | { | 994 | { |
995 | bool preserve; | 995 | bool preserve; |
996 | struct reflink_arguments args; | 996 | struct reflink_arguments args; |
997 | struct inode *inode = file->f_path.dentry->d_inode; | 997 | struct inode *inode = file_inode(file); |
998 | struct ocfs2_info info; | 998 | struct ocfs2_info info; |
999 | void __user *argp = (void __user *)arg; | 999 | void __user *argp = (void __user *)arg; |
1000 | 1000 | ||
diff --git a/fs/ocfs2/mmap.c b/fs/ocfs2/mmap.c index 47a87dda54ce..07c585b85000 100644 --- a/fs/ocfs2/mmap.c +++ b/fs/ocfs2/mmap.c | |||
@@ -62,7 +62,7 @@ static int __ocfs2_page_mkwrite(struct file *file, struct buffer_head *di_bh, | |||
62 | struct page *page) | 62 | struct page *page) |
63 | { | 63 | { |
64 | int ret = VM_FAULT_NOPAGE; | 64 | int ret = VM_FAULT_NOPAGE; |
65 | struct inode *inode = file->f_path.dentry->d_inode; | 65 | struct inode *inode = file_inode(file); |
66 | struct address_space *mapping = inode->i_mapping; | 66 | struct address_space *mapping = inode->i_mapping; |
67 | loff_t pos = page_offset(page); | 67 | loff_t pos = page_offset(page); |
68 | unsigned int len = PAGE_CACHE_SIZE; | 68 | unsigned int len = PAGE_CACHE_SIZE; |
@@ -131,7 +131,7 @@ out: | |||
131 | static int ocfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | 131 | static int ocfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) |
132 | { | 132 | { |
133 | struct page *page = vmf->page; | 133 | struct page *page = vmf->page; |
134 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; | 134 | struct inode *inode = file_inode(vma->vm_file); |
135 | struct buffer_head *di_bh = NULL; | 135 | struct buffer_head *di_bh = NULL; |
136 | sigset_t oldset; | 136 | sigset_t oldset; |
137 | int ret; | 137 | int ret; |
@@ -180,13 +180,13 @@ int ocfs2_mmap(struct file *file, struct vm_area_struct *vma) | |||
180 | { | 180 | { |
181 | int ret = 0, lock_level = 0; | 181 | int ret = 0, lock_level = 0; |
182 | 182 | ||
183 | ret = ocfs2_inode_lock_atime(file->f_dentry->d_inode, | 183 | ret = ocfs2_inode_lock_atime(file_inode(file), |
184 | file->f_vfsmnt, &lock_level); | 184 | file->f_vfsmnt, &lock_level); |
185 | if (ret < 0) { | 185 | if (ret < 0) { |
186 | mlog_errno(ret); | 186 | mlog_errno(ret); |
187 | goto out; | 187 | goto out; |
188 | } | 188 | } |
189 | ocfs2_inode_unlock(file->f_dentry->d_inode, lock_level); | 189 | ocfs2_inode_unlock(file_inode(file), lock_level); |
190 | out: | 190 | out: |
191 | vma->vm_ops = &ocfs2_file_vm_ops; | 191 | vma->vm_ops = &ocfs2_file_vm_ops; |
192 | return 0; | 192 | return 0; |
diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c index 6083432f667e..9f8dcadd9a50 100644 --- a/fs/ocfs2/move_extents.c +++ b/fs/ocfs2/move_extents.c | |||
@@ -1055,7 +1055,7 @@ int ocfs2_ioctl_move_extents(struct file *filp, void __user *argp) | |||
1055 | { | 1055 | { |
1056 | int status; | 1056 | int status; |
1057 | 1057 | ||
1058 | struct inode *inode = filp->f_path.dentry->d_inode; | 1058 | struct inode *inode = file_inode(filp); |
1059 | struct ocfs2_move_extents range; | 1059 | struct ocfs2_move_extents range; |
1060 | struct ocfs2_move_extents_context *context = NULL; | 1060 | struct ocfs2_move_extents_context *context = NULL; |
1061 | 1061 | ||
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 30a055049e16..1baffaadda41 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c | |||
@@ -2927,7 +2927,7 @@ int ocfs2_duplicate_clusters_by_page(handle_t *handle, | |||
2927 | u32 new_cluster, u32 new_len) | 2927 | u32 new_cluster, u32 new_len) |
2928 | { | 2928 | { |
2929 | int ret = 0, partial; | 2929 | int ret = 0, partial; |
2930 | struct inode *inode = file->f_path.dentry->d_inode; | 2930 | struct inode *inode = file_inode(file); |
2931 | struct ocfs2_caching_info *ci = INODE_CACHE(inode); | 2931 | struct ocfs2_caching_info *ci = INODE_CACHE(inode); |
2932 | struct super_block *sb = ocfs2_metadata_cache_get_super(ci); | 2932 | struct super_block *sb = ocfs2_metadata_cache_get_super(ci); |
2933 | u64 new_block = ocfs2_clusters_to_blocks(sb, new_cluster); | 2933 | u64 new_block = ocfs2_clusters_to_blocks(sb, new_cluster); |
@@ -3020,7 +3020,7 @@ int ocfs2_duplicate_clusters_by_jbd(handle_t *handle, | |||
3020 | u32 new_cluster, u32 new_len) | 3020 | u32 new_cluster, u32 new_len) |
3021 | { | 3021 | { |
3022 | int ret = 0; | 3022 | int ret = 0; |
3023 | struct inode *inode = file->f_path.dentry->d_inode; | 3023 | struct inode *inode = file_inode(file); |
3024 | struct super_block *sb = inode->i_sb; | 3024 | struct super_block *sb = inode->i_sb; |
3025 | struct ocfs2_caching_info *ci = INODE_CACHE(inode); | 3025 | struct ocfs2_caching_info *ci = INODE_CACHE(inode); |
3026 | int i, blocks = ocfs2_clusters_to_blocks(sb, new_len); | 3026 | int i, blocks = ocfs2_clusters_to_blocks(sb, new_len); |
diff --git a/fs/omfs/dir.c b/fs/omfs/dir.c index fb5b3ff79dc6..acbaebcad3a8 100644 --- a/fs/omfs/dir.c +++ b/fs/omfs/dir.c | |||
@@ -330,7 +330,7 @@ int omfs_is_bad(struct omfs_sb_info *sbi, struct omfs_header *header, | |||
330 | static int omfs_fill_chain(struct file *filp, void *dirent, filldir_t filldir, | 330 | static int omfs_fill_chain(struct file *filp, void *dirent, filldir_t filldir, |
331 | u64 fsblock, int hindex) | 331 | u64 fsblock, int hindex) |
332 | { | 332 | { |
333 | struct inode *dir = filp->f_dentry->d_inode; | 333 | struct inode *dir = file_inode(filp); |
334 | struct buffer_head *bh; | 334 | struct buffer_head *bh; |
335 | struct omfs_inode *oi; | 335 | struct omfs_inode *oi; |
336 | u64 self; | 336 | u64 self; |
@@ -405,7 +405,7 @@ out: | |||
405 | 405 | ||
406 | static int omfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | 406 | static int omfs_readdir(struct file *filp, void *dirent, filldir_t filldir) |
407 | { | 407 | { |
408 | struct inode *dir = filp->f_dentry->d_inode; | 408 | struct inode *dir = file_inode(filp); |
409 | struct buffer_head *bh; | 409 | struct buffer_head *bh; |
410 | loff_t offset, res; | 410 | loff_t offset, res; |
411 | unsigned int hchain, hindex; | 411 | unsigned int hchain, hindex; |
@@ -228,7 +228,7 @@ SYSCALL_ALIAS(sys_ftruncate64, SyS_ftruncate64); | |||
228 | 228 | ||
229 | int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len) | 229 | int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len) |
230 | { | 230 | { |
231 | struct inode *inode = file->f_path.dentry->d_inode; | 231 | struct inode *inode = file_inode(file); |
232 | long ret; | 232 | long ret; |
233 | 233 | ||
234 | if (offset < 0 || len <= 0) | 234 | if (offset < 0 || len <= 0) |
@@ -426,7 +426,7 @@ SYSCALL_DEFINE1(fchdir, unsigned int, fd) | |||
426 | if (!f.file) | 426 | if (!f.file) |
427 | goto out; | 427 | goto out; |
428 | 428 | ||
429 | inode = f.file->f_path.dentry->d_inode; | 429 | inode = file_inode(f.file); |
430 | 430 | ||
431 | error = -ENOTDIR; | 431 | error = -ENOTDIR; |
432 | if (!S_ISDIR(inode->i_mode)) | 432 | if (!S_ISDIR(inode->i_mode)) |
@@ -689,7 +689,7 @@ static int do_dentry_open(struct file *f, | |||
689 | f->f_mode = FMODE_PATH; | 689 | f->f_mode = FMODE_PATH; |
690 | 690 | ||
691 | path_get(&f->f_path); | 691 | path_get(&f->f_path); |
692 | inode = f->f_path.dentry->d_inode; | 692 | inode = file_inode(f); |
693 | if (f->f_mode & FMODE_WRITE) { | 693 | if (f->f_mode & FMODE_WRITE) { |
694 | error = __get_file_write_access(inode, f->f_path.mnt); | 694 | error = __get_file_write_access(inode, f->f_path.mnt); |
695 | if (error) | 695 | if (error) |
diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c index 2ad080faca34..ae47fa7efb9d 100644 --- a/fs/openpromfs/inode.c +++ b/fs/openpromfs/inode.c | |||
@@ -262,7 +262,7 @@ found: | |||
262 | 262 | ||
263 | static int openpromfs_readdir(struct file * filp, void * dirent, filldir_t filldir) | 263 | static int openpromfs_readdir(struct file * filp, void * dirent, filldir_t filldir) |
264 | { | 264 | { |
265 | struct inode *inode = filp->f_path.dentry->d_inode; | 265 | struct inode *inode = file_inode(filp); |
266 | struct op_inode_info *oi = OP_I(inode); | 266 | struct op_inode_info *oi = OP_I(inode); |
267 | struct device_node *dp = oi->u.node; | 267 | struct device_node *dp = oi->u.node; |
268 | struct device_node *child; | 268 | struct device_node *child; |
@@ -361,7 +361,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov, | |||
361 | unsigned long nr_segs, loff_t pos) | 361 | unsigned long nr_segs, loff_t pos) |
362 | { | 362 | { |
363 | struct file *filp = iocb->ki_filp; | 363 | struct file *filp = iocb->ki_filp; |
364 | struct inode *inode = filp->f_path.dentry->d_inode; | 364 | struct inode *inode = file_inode(filp); |
365 | struct pipe_inode_info *pipe; | 365 | struct pipe_inode_info *pipe; |
366 | int do_wakeup; | 366 | int do_wakeup; |
367 | ssize_t ret; | 367 | ssize_t ret; |
@@ -486,7 +486,7 @@ pipe_write(struct kiocb *iocb, const struct iovec *_iov, | |||
486 | unsigned long nr_segs, loff_t ppos) | 486 | unsigned long nr_segs, loff_t ppos) |
487 | { | 487 | { |
488 | struct file *filp = iocb->ki_filp; | 488 | struct file *filp = iocb->ki_filp; |
489 | struct inode *inode = filp->f_path.dentry->d_inode; | 489 | struct inode *inode = file_inode(filp); |
490 | struct pipe_inode_info *pipe; | 490 | struct pipe_inode_info *pipe; |
491 | ssize_t ret; | 491 | ssize_t ret; |
492 | int do_wakeup; | 492 | int do_wakeup; |
@@ -677,7 +677,7 @@ bad_pipe_w(struct file *filp, const char __user *buf, size_t count, | |||
677 | 677 | ||
678 | static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 678 | static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
679 | { | 679 | { |
680 | struct inode *inode = filp->f_path.dentry->d_inode; | 680 | struct inode *inode = file_inode(filp); |
681 | struct pipe_inode_info *pipe; | 681 | struct pipe_inode_info *pipe; |
682 | int count, buf, nrbufs; | 682 | int count, buf, nrbufs; |
683 | 683 | ||
@@ -705,7 +705,7 @@ static unsigned int | |||
705 | pipe_poll(struct file *filp, poll_table *wait) | 705 | pipe_poll(struct file *filp, poll_table *wait) |
706 | { | 706 | { |
707 | unsigned int mask; | 707 | unsigned int mask; |
708 | struct inode *inode = filp->f_path.dentry->d_inode; | 708 | struct inode *inode = file_inode(filp); |
709 | struct pipe_inode_info *pipe = inode->i_pipe; | 709 | struct pipe_inode_info *pipe = inode->i_pipe; |
710 | int nrbufs; | 710 | int nrbufs; |
711 | 711 | ||
@@ -758,7 +758,7 @@ pipe_release(struct inode *inode, int decr, int decw) | |||
758 | static int | 758 | static int |
759 | pipe_read_fasync(int fd, struct file *filp, int on) | 759 | pipe_read_fasync(int fd, struct file *filp, int on) |
760 | { | 760 | { |
761 | struct inode *inode = filp->f_path.dentry->d_inode; | 761 | struct inode *inode = file_inode(filp); |
762 | int retval; | 762 | int retval; |
763 | 763 | ||
764 | mutex_lock(&inode->i_mutex); | 764 | mutex_lock(&inode->i_mutex); |
@@ -772,7 +772,7 @@ pipe_read_fasync(int fd, struct file *filp, int on) | |||
772 | static int | 772 | static int |
773 | pipe_write_fasync(int fd, struct file *filp, int on) | 773 | pipe_write_fasync(int fd, struct file *filp, int on) |
774 | { | 774 | { |
775 | struct inode *inode = filp->f_path.dentry->d_inode; | 775 | struct inode *inode = file_inode(filp); |
776 | int retval; | 776 | int retval; |
777 | 777 | ||
778 | mutex_lock(&inode->i_mutex); | 778 | mutex_lock(&inode->i_mutex); |
@@ -786,7 +786,7 @@ pipe_write_fasync(int fd, struct file *filp, int on) | |||
786 | static int | 786 | static int |
787 | pipe_rdwr_fasync(int fd, struct file *filp, int on) | 787 | pipe_rdwr_fasync(int fd, struct file *filp, int on) |
788 | { | 788 | { |
789 | struct inode *inode = filp->f_path.dentry->d_inode; | 789 | struct inode *inode = file_inode(filp); |
790 | struct pipe_inode_info *pipe = inode->i_pipe; | 790 | struct pipe_inode_info *pipe = inode->i_pipe; |
791 | int retval; | 791 | int retval; |
792 | 792 | ||
@@ -1226,7 +1226,7 @@ int pipe_proc_fn(struct ctl_table *table, int write, void __user *buf, | |||
1226 | */ | 1226 | */ |
1227 | struct pipe_inode_info *get_pipe_info(struct file *file) | 1227 | struct pipe_inode_info *get_pipe_info(struct file *file) |
1228 | { | 1228 | { |
1229 | struct inode *i = file->f_path.dentry->d_inode; | 1229 | struct inode *i = file_inode(file); |
1230 | 1230 | ||
1231 | return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL; | 1231 | return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL; |
1232 | } | 1232 | } |
diff --git a/fs/proc/base.c b/fs/proc/base.c index 9b43ff77a51e..760268d6cba6 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -383,7 +383,7 @@ static int lstats_open(struct inode *inode, struct file *file) | |||
383 | static ssize_t lstats_write(struct file *file, const char __user *buf, | 383 | static ssize_t lstats_write(struct file *file, const char __user *buf, |
384 | size_t count, loff_t *offs) | 384 | size_t count, loff_t *offs) |
385 | { | 385 | { |
386 | struct task_struct *task = get_proc_task(file->f_dentry->d_inode); | 386 | struct task_struct *task = get_proc_task(file_inode(file)); |
387 | 387 | ||
388 | if (!task) | 388 | if (!task) |
389 | return -ESRCH; | 389 | return -ESRCH; |
@@ -602,7 +602,7 @@ static const struct inode_operations proc_def_inode_operations = { | |||
602 | static ssize_t proc_info_read(struct file * file, char __user * buf, | 602 | static ssize_t proc_info_read(struct file * file, char __user * buf, |
603 | size_t count, loff_t *ppos) | 603 | size_t count, loff_t *ppos) |
604 | { | 604 | { |
605 | struct inode * inode = file->f_path.dentry->d_inode; | 605 | struct inode * inode = file_inode(file); |
606 | unsigned long page; | 606 | unsigned long page; |
607 | ssize_t length; | 607 | ssize_t length; |
608 | struct task_struct *task = get_proc_task(inode); | 608 | struct task_struct *task = get_proc_task(inode); |
@@ -668,7 +668,7 @@ static const struct file_operations proc_single_file_operations = { | |||
668 | 668 | ||
669 | static int __mem_open(struct inode *inode, struct file *file, unsigned int mode) | 669 | static int __mem_open(struct inode *inode, struct file *file, unsigned int mode) |
670 | { | 670 | { |
671 | struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode); | 671 | struct task_struct *task = get_proc_task(file_inode(file)); |
672 | struct mm_struct *mm; | 672 | struct mm_struct *mm; |
673 | 673 | ||
674 | if (!task) | 674 | if (!task) |
@@ -869,7 +869,7 @@ static const struct file_operations proc_environ_operations = { | |||
869 | static ssize_t oom_adj_read(struct file *file, char __user *buf, size_t count, | 869 | static ssize_t oom_adj_read(struct file *file, char __user *buf, size_t count, |
870 | loff_t *ppos) | 870 | loff_t *ppos) |
871 | { | 871 | { |
872 | struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode); | 872 | struct task_struct *task = get_proc_task(file_inode(file)); |
873 | char buffer[PROC_NUMBUF]; | 873 | char buffer[PROC_NUMBUF]; |
874 | int oom_adj = OOM_ADJUST_MIN; | 874 | int oom_adj = OOM_ADJUST_MIN; |
875 | size_t len; | 875 | size_t len; |
@@ -916,7 +916,7 @@ static ssize_t oom_adj_write(struct file *file, const char __user *buf, | |||
916 | goto out; | 916 | goto out; |
917 | } | 917 | } |
918 | 918 | ||
919 | task = get_proc_task(file->f_path.dentry->d_inode); | 919 | task = get_proc_task(file_inode(file)); |
920 | if (!task) { | 920 | if (!task) { |
921 | err = -ESRCH; | 921 | err = -ESRCH; |
922 | goto out; | 922 | goto out; |
@@ -976,7 +976,7 @@ static const struct file_operations proc_oom_adj_operations = { | |||
976 | static ssize_t oom_score_adj_read(struct file *file, char __user *buf, | 976 | static ssize_t oom_score_adj_read(struct file *file, char __user *buf, |
977 | size_t count, loff_t *ppos) | 977 | size_t count, loff_t *ppos) |
978 | { | 978 | { |
979 | struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode); | 979 | struct task_struct *task = get_proc_task(file_inode(file)); |
980 | char buffer[PROC_NUMBUF]; | 980 | char buffer[PROC_NUMBUF]; |
981 | short oom_score_adj = OOM_SCORE_ADJ_MIN; | 981 | short oom_score_adj = OOM_SCORE_ADJ_MIN; |
982 | unsigned long flags; | 982 | unsigned long flags; |
@@ -1019,7 +1019,7 @@ static ssize_t oom_score_adj_write(struct file *file, const char __user *buf, | |||
1019 | goto out; | 1019 | goto out; |
1020 | } | 1020 | } |
1021 | 1021 | ||
1022 | task = get_proc_task(file->f_path.dentry->d_inode); | 1022 | task = get_proc_task(file_inode(file)); |
1023 | if (!task) { | 1023 | if (!task) { |
1024 | err = -ESRCH; | 1024 | err = -ESRCH; |
1025 | goto out; | 1025 | goto out; |
@@ -1067,7 +1067,7 @@ static const struct file_operations proc_oom_score_adj_operations = { | |||
1067 | static ssize_t proc_loginuid_read(struct file * file, char __user * buf, | 1067 | static ssize_t proc_loginuid_read(struct file * file, char __user * buf, |
1068 | size_t count, loff_t *ppos) | 1068 | size_t count, loff_t *ppos) |
1069 | { | 1069 | { |
1070 | struct inode * inode = file->f_path.dentry->d_inode; | 1070 | struct inode * inode = file_inode(file); |
1071 | struct task_struct *task = get_proc_task(inode); | 1071 | struct task_struct *task = get_proc_task(inode); |
1072 | ssize_t length; | 1072 | ssize_t length; |
1073 | char tmpbuf[TMPBUFLEN]; | 1073 | char tmpbuf[TMPBUFLEN]; |
@@ -1084,7 +1084,7 @@ static ssize_t proc_loginuid_read(struct file * file, char __user * buf, | |||
1084 | static ssize_t proc_loginuid_write(struct file * file, const char __user * buf, | 1084 | static ssize_t proc_loginuid_write(struct file * file, const char __user * buf, |
1085 | size_t count, loff_t *ppos) | 1085 | size_t count, loff_t *ppos) |
1086 | { | 1086 | { |
1087 | struct inode * inode = file->f_path.dentry->d_inode; | 1087 | struct inode * inode = file_inode(file); |
1088 | char *page, *tmp; | 1088 | char *page, *tmp; |
1089 | ssize_t length; | 1089 | ssize_t length; |
1090 | uid_t loginuid; | 1090 | uid_t loginuid; |
@@ -1142,7 +1142,7 @@ static const struct file_operations proc_loginuid_operations = { | |||
1142 | static ssize_t proc_sessionid_read(struct file * file, char __user * buf, | 1142 | static ssize_t proc_sessionid_read(struct file * file, char __user * buf, |
1143 | size_t count, loff_t *ppos) | 1143 | size_t count, loff_t *ppos) |
1144 | { | 1144 | { |
1145 | struct inode * inode = file->f_path.dentry->d_inode; | 1145 | struct inode * inode = file_inode(file); |
1146 | struct task_struct *task = get_proc_task(inode); | 1146 | struct task_struct *task = get_proc_task(inode); |
1147 | ssize_t length; | 1147 | ssize_t length; |
1148 | char tmpbuf[TMPBUFLEN]; | 1148 | char tmpbuf[TMPBUFLEN]; |
@@ -1165,7 +1165,7 @@ static const struct file_operations proc_sessionid_operations = { | |||
1165 | static ssize_t proc_fault_inject_read(struct file * file, char __user * buf, | 1165 | static ssize_t proc_fault_inject_read(struct file * file, char __user * buf, |
1166 | size_t count, loff_t *ppos) | 1166 | size_t count, loff_t *ppos) |
1167 | { | 1167 | { |
1168 | struct task_struct *task = get_proc_task(file->f_dentry->d_inode); | 1168 | struct task_struct *task = get_proc_task(file_inode(file)); |
1169 | char buffer[PROC_NUMBUF]; | 1169 | char buffer[PROC_NUMBUF]; |
1170 | size_t len; | 1170 | size_t len; |
1171 | int make_it_fail; | 1171 | int make_it_fail; |
@@ -1197,7 +1197,7 @@ static ssize_t proc_fault_inject_write(struct file * file, | |||
1197 | make_it_fail = simple_strtol(strstrip(buffer), &end, 0); | 1197 | make_it_fail = simple_strtol(strstrip(buffer), &end, 0); |
1198 | if (*end) | 1198 | if (*end) |
1199 | return -EINVAL; | 1199 | return -EINVAL; |
1200 | task = get_proc_task(file->f_dentry->d_inode); | 1200 | task = get_proc_task(file_inode(file)); |
1201 | if (!task) | 1201 | if (!task) |
1202 | return -ESRCH; | 1202 | return -ESRCH; |
1203 | task->make_it_fail = make_it_fail; | 1203 | task->make_it_fail = make_it_fail; |
@@ -1237,7 +1237,7 @@ static ssize_t | |||
1237 | sched_write(struct file *file, const char __user *buf, | 1237 | sched_write(struct file *file, const char __user *buf, |
1238 | size_t count, loff_t *offset) | 1238 | size_t count, loff_t *offset) |
1239 | { | 1239 | { |
1240 | struct inode *inode = file->f_path.dentry->d_inode; | 1240 | struct inode *inode = file_inode(file); |
1241 | struct task_struct *p; | 1241 | struct task_struct *p; |
1242 | 1242 | ||
1243 | p = get_proc_task(inode); | 1243 | p = get_proc_task(inode); |
@@ -1288,7 +1288,7 @@ static ssize_t | |||
1288 | sched_autogroup_write(struct file *file, const char __user *buf, | 1288 | sched_autogroup_write(struct file *file, const char __user *buf, |
1289 | size_t count, loff_t *offset) | 1289 | size_t count, loff_t *offset) |
1290 | { | 1290 | { |
1291 | struct inode *inode = file->f_path.dentry->d_inode; | 1291 | struct inode *inode = file_inode(file); |
1292 | struct task_struct *p; | 1292 | struct task_struct *p; |
1293 | char buffer[PROC_NUMBUF]; | 1293 | char buffer[PROC_NUMBUF]; |
1294 | int nice; | 1294 | int nice; |
@@ -1343,7 +1343,7 @@ static const struct file_operations proc_pid_sched_autogroup_operations = { | |||
1343 | static ssize_t comm_write(struct file *file, const char __user *buf, | 1343 | static ssize_t comm_write(struct file *file, const char __user *buf, |
1344 | size_t count, loff_t *offset) | 1344 | size_t count, loff_t *offset) |
1345 | { | 1345 | { |
1346 | struct inode *inode = file->f_path.dentry->d_inode; | 1346 | struct inode *inode = file_inode(file); |
1347 | struct task_struct *p; | 1347 | struct task_struct *p; |
1348 | char buffer[TASK_COMM_LEN]; | 1348 | char buffer[TASK_COMM_LEN]; |
1349 | 1349 | ||
@@ -2146,7 +2146,7 @@ out_no_task: | |||
2146 | static ssize_t proc_pid_attr_read(struct file * file, char __user * buf, | 2146 | static ssize_t proc_pid_attr_read(struct file * file, char __user * buf, |
2147 | size_t count, loff_t *ppos) | 2147 | size_t count, loff_t *ppos) |
2148 | { | 2148 | { |
2149 | struct inode * inode = file->f_path.dentry->d_inode; | 2149 | struct inode * inode = file_inode(file); |
2150 | char *p = NULL; | 2150 | char *p = NULL; |
2151 | ssize_t length; | 2151 | ssize_t length; |
2152 | struct task_struct *task = get_proc_task(inode); | 2152 | struct task_struct *task = get_proc_task(inode); |
@@ -2167,7 +2167,7 @@ static ssize_t proc_pid_attr_read(struct file * file, char __user * buf, | |||
2167 | static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf, | 2167 | static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf, |
2168 | size_t count, loff_t *ppos) | 2168 | size_t count, loff_t *ppos) |
2169 | { | 2169 | { |
2170 | struct inode * inode = file->f_path.dentry->d_inode; | 2170 | struct inode * inode = file_inode(file); |
2171 | char *page; | 2171 | char *page; |
2172 | ssize_t length; | 2172 | ssize_t length; |
2173 | struct task_struct *task = get_proc_task(inode); | 2173 | struct task_struct *task = get_proc_task(inode); |
@@ -2256,7 +2256,7 @@ static const struct inode_operations proc_attr_dir_inode_operations = { | |||
2256 | static ssize_t proc_coredump_filter_read(struct file *file, char __user *buf, | 2256 | static ssize_t proc_coredump_filter_read(struct file *file, char __user *buf, |
2257 | size_t count, loff_t *ppos) | 2257 | size_t count, loff_t *ppos) |
2258 | { | 2258 | { |
2259 | struct task_struct *task = get_proc_task(file->f_dentry->d_inode); | 2259 | struct task_struct *task = get_proc_task(file_inode(file)); |
2260 | struct mm_struct *mm; | 2260 | struct mm_struct *mm; |
2261 | char buffer[PROC_NUMBUF]; | 2261 | char buffer[PROC_NUMBUF]; |
2262 | size_t len; | 2262 | size_t len; |
@@ -2308,7 +2308,7 @@ static ssize_t proc_coredump_filter_write(struct file *file, | |||
2308 | goto out_no_task; | 2308 | goto out_no_task; |
2309 | 2309 | ||
2310 | ret = -ESRCH; | 2310 | ret = -ESRCH; |
2311 | task = get_proc_task(file->f_dentry->d_inode); | 2311 | task = get_proc_task(file_inode(file)); |
2312 | if (!task) | 2312 | if (!task) |
2313 | goto out_no_task; | 2313 | goto out_no_task; |
2314 | 2314 | ||
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 76ddae83daa5..7dfe548a28e8 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
@@ -42,7 +42,7 @@ static ssize_t | |||
42 | __proc_file_read(struct file *file, char __user *buf, size_t nbytes, | 42 | __proc_file_read(struct file *file, char __user *buf, size_t nbytes, |
43 | loff_t *ppos) | 43 | loff_t *ppos) |
44 | { | 44 | { |
45 | struct inode * inode = file->f_path.dentry->d_inode; | 45 | struct inode * inode = file_inode(file); |
46 | char *page; | 46 | char *page; |
47 | ssize_t retval=0; | 47 | ssize_t retval=0; |
48 | int eof=0; | 48 | int eof=0; |
@@ -188,7 +188,7 @@ static ssize_t | |||
188 | proc_file_read(struct file *file, char __user *buf, size_t nbytes, | 188 | proc_file_read(struct file *file, char __user *buf, size_t nbytes, |
189 | loff_t *ppos) | 189 | loff_t *ppos) |
190 | { | 190 | { |
191 | struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | 191 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
192 | ssize_t rv = -EIO; | 192 | ssize_t rv = -EIO; |
193 | 193 | ||
194 | spin_lock(&pde->pde_unload_lock); | 194 | spin_lock(&pde->pde_unload_lock); |
@@ -209,7 +209,7 @@ static ssize_t | |||
209 | proc_file_write(struct file *file, const char __user *buffer, | 209 | proc_file_write(struct file *file, const char __user *buffer, |
210 | size_t count, loff_t *ppos) | 210 | size_t count, loff_t *ppos) |
211 | { | 211 | { |
212 | struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | 212 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
213 | ssize_t rv = -EIO; | 213 | ssize_t rv = -EIO; |
214 | 214 | ||
215 | if (pde->write_proc) { | 215 | if (pde->write_proc) { |
@@ -460,7 +460,7 @@ int proc_readdir_de(struct proc_dir_entry *de, struct file *filp, void *dirent, | |||
460 | { | 460 | { |
461 | unsigned int ino; | 461 | unsigned int ino; |
462 | int i; | 462 | int i; |
463 | struct inode *inode = filp->f_path.dentry->d_inode; | 463 | struct inode *inode = file_inode(filp); |
464 | int ret = 0; | 464 | int ret = 0; |
465 | 465 | ||
466 | ino = inode->i_ino; | 466 | ino = inode->i_ino; |
@@ -522,7 +522,7 @@ out: | |||
522 | 522 | ||
523 | int proc_readdir(struct file *filp, void *dirent, filldir_t filldir) | 523 | int proc_readdir(struct file *filp, void *dirent, filldir_t filldir) |
524 | { | 524 | { |
525 | struct inode *inode = filp->f_path.dentry->d_inode; | 525 | struct inode *inode = file_inode(filp); |
526 | 526 | ||
527 | return proc_readdir_de(PDE(inode), filp, dirent, filldir); | 527 | return proc_readdir_de(PDE(inode), filp, dirent, filldir); |
528 | } | 528 | } |
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 439ae6886507..38f5c119b806 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
@@ -144,7 +144,7 @@ void pde_users_dec(struct proc_dir_entry *pde) | |||
144 | 144 | ||
145 | static loff_t proc_reg_llseek(struct file *file, loff_t offset, int whence) | 145 | static loff_t proc_reg_llseek(struct file *file, loff_t offset, int whence) |
146 | { | 146 | { |
147 | struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | 147 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
148 | loff_t rv = -EINVAL; | 148 | loff_t rv = -EINVAL; |
149 | loff_t (*llseek)(struct file *, loff_t, int); | 149 | loff_t (*llseek)(struct file *, loff_t, int); |
150 | 150 | ||
@@ -179,7 +179,7 @@ static loff_t proc_reg_llseek(struct file *file, loff_t offset, int whence) | |||
179 | 179 | ||
180 | static ssize_t proc_reg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) | 180 | static ssize_t proc_reg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) |
181 | { | 181 | { |
182 | struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | 182 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
183 | ssize_t rv = -EIO; | 183 | ssize_t rv = -EIO; |
184 | ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); | 184 | ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); |
185 | 185 | ||
@@ -201,7 +201,7 @@ static ssize_t proc_reg_read(struct file *file, char __user *buf, size_t count, | |||
201 | 201 | ||
202 | static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) | 202 | static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) |
203 | { | 203 | { |
204 | struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | 204 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
205 | ssize_t rv = -EIO; | 205 | ssize_t rv = -EIO; |
206 | ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *); | 206 | ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *); |
207 | 207 | ||
@@ -223,7 +223,7 @@ static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t | |||
223 | 223 | ||
224 | static unsigned int proc_reg_poll(struct file *file, struct poll_table_struct *pts) | 224 | static unsigned int proc_reg_poll(struct file *file, struct poll_table_struct *pts) |
225 | { | 225 | { |
226 | struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | 226 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
227 | unsigned int rv = DEFAULT_POLLMASK; | 227 | unsigned int rv = DEFAULT_POLLMASK; |
228 | unsigned int (*poll)(struct file *, struct poll_table_struct *); | 228 | unsigned int (*poll)(struct file *, struct poll_table_struct *); |
229 | 229 | ||
@@ -245,7 +245,7 @@ static unsigned int proc_reg_poll(struct file *file, struct poll_table_struct *p | |||
245 | 245 | ||
246 | static long proc_reg_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 246 | static long proc_reg_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
247 | { | 247 | { |
248 | struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | 248 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
249 | long rv = -ENOTTY; | 249 | long rv = -ENOTTY; |
250 | long (*ioctl)(struct file *, unsigned int, unsigned long); | 250 | long (*ioctl)(struct file *, unsigned int, unsigned long); |
251 | 251 | ||
@@ -268,7 +268,7 @@ static long proc_reg_unlocked_ioctl(struct file *file, unsigned int cmd, unsigne | |||
268 | #ifdef CONFIG_COMPAT | 268 | #ifdef CONFIG_COMPAT |
269 | static long proc_reg_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 269 | static long proc_reg_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
270 | { | 270 | { |
271 | struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | 271 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
272 | long rv = -ENOTTY; | 272 | long rv = -ENOTTY; |
273 | long (*compat_ioctl)(struct file *, unsigned int, unsigned long); | 273 | long (*compat_ioctl)(struct file *, unsigned int, unsigned long); |
274 | 274 | ||
@@ -291,7 +291,7 @@ static long proc_reg_compat_ioctl(struct file *file, unsigned int cmd, unsigned | |||
291 | 291 | ||
292 | static int proc_reg_mmap(struct file *file, struct vm_area_struct *vma) | 292 | static int proc_reg_mmap(struct file *file, struct vm_area_struct *vma) |
293 | { | 293 | { |
294 | struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | 294 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
295 | int rv = -EIO; | 295 | int rv = -EIO; |
296 | int (*mmap)(struct file *, struct vm_area_struct *); | 296 | int (*mmap)(struct file *, struct vm_area_struct *); |
297 | 297 | ||
diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c index b1822dde55c2..ccfd99bd1c5a 100644 --- a/fs/proc/nommu.c +++ b/fs/proc/nommu.c | |||
@@ -45,7 +45,7 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region) | |||
45 | file = region->vm_file; | 45 | file = region->vm_file; |
46 | 46 | ||
47 | if (file) { | 47 | if (file) { |
48 | struct inode *inode = region->vm_file->f_path.dentry->d_inode; | 48 | struct inode *inode = file_inode(region->vm_file); |
49 | dev = inode->i_sb->s_dev; | 49 | dev = inode->i_sb->s_dev; |
50 | ino = inode->i_ino; | 50 | ino = inode->i_ino; |
51 | } | 51 | } |
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c index fe72cd073dea..75df0d731110 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c | |||
@@ -163,7 +163,7 @@ static int proc_tgid_net_readdir(struct file *filp, void *dirent, | |||
163 | struct net *net; | 163 | struct net *net; |
164 | 164 | ||
165 | ret = -EINVAL; | 165 | ret = -EINVAL; |
166 | net = get_proc_task_net(filp->f_path.dentry->d_inode); | 166 | net = get_proc_task_net(file_inode(filp)); |
167 | if (net != NULL) { | 167 | if (net != NULL) { |
168 | ret = proc_readdir_de(net->proc_net, filp, dirent, filldir); | 168 | ret = proc_readdir_de(net->proc_net, filp, dirent, filldir); |
169 | put_net(net); | 169 | put_net(net); |
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 1827d88ad58b..612df79cc6a1 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c | |||
@@ -478,7 +478,7 @@ out: | |||
478 | static ssize_t proc_sys_call_handler(struct file *filp, void __user *buf, | 478 | static ssize_t proc_sys_call_handler(struct file *filp, void __user *buf, |
479 | size_t count, loff_t *ppos, int write) | 479 | size_t count, loff_t *ppos, int write) |
480 | { | 480 | { |
481 | struct inode *inode = filp->f_path.dentry->d_inode; | 481 | struct inode *inode = file_inode(filp); |
482 | struct ctl_table_header *head = grab_header(inode); | 482 | struct ctl_table_header *head = grab_header(inode); |
483 | struct ctl_table *table = PROC_I(inode)->sysctl_entry; | 483 | struct ctl_table *table = PROC_I(inode)->sysctl_entry; |
484 | ssize_t error; | 484 | ssize_t error; |
@@ -542,7 +542,7 @@ static int proc_sys_open(struct inode *inode, struct file *filp) | |||
542 | 542 | ||
543 | static unsigned int proc_sys_poll(struct file *filp, poll_table *wait) | 543 | static unsigned int proc_sys_poll(struct file *filp, poll_table *wait) |
544 | { | 544 | { |
545 | struct inode *inode = filp->f_path.dentry->d_inode; | 545 | struct inode *inode = file_inode(filp); |
546 | struct ctl_table_header *head = grab_header(inode); | 546 | struct ctl_table_header *head = grab_header(inode); |
547 | struct ctl_table *table = PROC_I(inode)->sysctl_entry; | 547 | struct ctl_table *table = PROC_I(inode)->sysctl_entry; |
548 | unsigned int ret = DEFAULT_POLLMASK; | 548 | unsigned int ret = DEFAULT_POLLMASK; |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index ca5ce7f9f800..3e636d864d56 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -271,7 +271,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid) | |||
271 | const char *name = NULL; | 271 | const char *name = NULL; |
272 | 272 | ||
273 | if (file) { | 273 | if (file) { |
274 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; | 274 | struct inode *inode = file_inode(vma->vm_file); |
275 | dev = inode->i_sb->s_dev; | 275 | dev = inode->i_sb->s_dev; |
276 | ino = inode->i_ino; | 276 | ino = inode->i_ino; |
277 | pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; | 277 | pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; |
@@ -743,7 +743,7 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf, | |||
743 | return rv; | 743 | return rv; |
744 | if (type < CLEAR_REFS_ALL || type > CLEAR_REFS_MAPPED) | 744 | if (type < CLEAR_REFS_ALL || type > CLEAR_REFS_MAPPED) |
745 | return -EINVAL; | 745 | return -EINVAL; |
746 | task = get_proc_task(file->f_path.dentry->d_inode); | 746 | task = get_proc_task(file_inode(file)); |
747 | if (!task) | 747 | if (!task) |
748 | return -ESRCH; | 748 | return -ESRCH; |
749 | mm = get_task_mm(task); | 749 | mm = get_task_mm(task); |
@@ -1015,7 +1015,7 @@ static int pagemap_hugetlb_range(pte_t *pte, unsigned long hmask, | |||
1015 | static ssize_t pagemap_read(struct file *file, char __user *buf, | 1015 | static ssize_t pagemap_read(struct file *file, char __user *buf, |
1016 | size_t count, loff_t *ppos) | 1016 | size_t count, loff_t *ppos) |
1017 | { | 1017 | { |
1018 | struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode); | 1018 | struct task_struct *task = get_proc_task(file_inode(file)); |
1019 | struct mm_struct *mm; | 1019 | struct mm_struct *mm; |
1020 | struct pagemapread pm; | 1020 | struct pagemapread pm; |
1021 | int ret = -ESRCH; | 1021 | int ret = -ESRCH; |
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c index 1ccfa537f5f5..56123a6f462e 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c | |||
@@ -149,7 +149,7 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma, | |||
149 | file = vma->vm_file; | 149 | file = vma->vm_file; |
150 | 150 | ||
151 | if (file) { | 151 | if (file) { |
152 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; | 152 | struct inode *inode = file_inode(vma->vm_file); |
153 | dev = inode->i_sb->s_dev; | 153 | dev = inode->i_sb->s_dev; |
154 | ino = inode->i_ino; | 154 | ino = inode->i_ino; |
155 | pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT; | 155 | pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT; |
diff --git a/fs/qnx4/dir.c b/fs/qnx4/dir.c index 7b0329468a5d..28ce014b3cef 100644 --- a/fs/qnx4/dir.c +++ b/fs/qnx4/dir.c | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | static int qnx4_readdir(struct file *filp, void *dirent, filldir_t filldir) | 17 | static int qnx4_readdir(struct file *filp, void *dirent, filldir_t filldir) |
18 | { | 18 | { |
19 | struct inode *inode = filp->f_path.dentry->d_inode; | 19 | struct inode *inode = file_inode(filp); |
20 | unsigned int offset; | 20 | unsigned int offset; |
21 | struct buffer_head *bh; | 21 | struct buffer_head *bh; |
22 | struct qnx4_inode_entry *de; | 22 | struct qnx4_inode_entry *de; |
diff --git a/fs/qnx6/dir.c b/fs/qnx6/dir.c index dc597353db3b..8798d065e400 100644 --- a/fs/qnx6/dir.c +++ b/fs/qnx6/dir.c | |||
@@ -117,7 +117,7 @@ static int qnx6_dir_longfilename(struct inode *inode, | |||
117 | 117 | ||
118 | static int qnx6_readdir(struct file *filp, void *dirent, filldir_t filldir) | 118 | static int qnx6_readdir(struct file *filp, void *dirent, filldir_t filldir) |
119 | { | 119 | { |
120 | struct inode *inode = filp->f_path.dentry->d_inode; | 120 | struct inode *inode = file_inode(filp); |
121 | struct super_block *s = inode->i_sb; | 121 | struct super_block *s = inode->i_sb; |
122 | struct qnx6_sb_info *sbi = QNX6_SB(s); | 122 | struct qnx6_sb_info *sbi = QNX6_SB(s); |
123 | loff_t pos = filp->f_pos & (QNX6_DIR_ENTRY_SIZE - 1); | 123 | loff_t pos = filp->f_pos & (QNX6_DIR_ENTRY_SIZE - 1); |
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index d5378d028589..8d5b438cc188 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c | |||
@@ -202,7 +202,7 @@ unsigned long ramfs_nommu_get_unmapped_area(struct file *file, | |||
202 | unsigned long pgoff, unsigned long flags) | 202 | unsigned long pgoff, unsigned long flags) |
203 | { | 203 | { |
204 | unsigned long maxpages, lpages, nr, loop, ret; | 204 | unsigned long maxpages, lpages, nr, loop, ret; |
205 | struct inode *inode = file->f_path.dentry->d_inode; | 205 | struct inode *inode = file_inode(file); |
206 | struct page **pages = NULL, **ptr, *page; | 206 | struct page **pages = NULL, **ptr, *page; |
207 | loff_t isize; | 207 | loff_t isize; |
208 | 208 | ||
diff --git a/fs/read_write.c b/fs/read_write.c index bb34af315280..3ae6dbe828bf 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
@@ -163,7 +163,7 @@ EXPORT_SYMBOL(no_llseek); | |||
163 | 163 | ||
164 | loff_t default_llseek(struct file *file, loff_t offset, int whence) | 164 | loff_t default_llseek(struct file *file, loff_t offset, int whence) |
165 | { | 165 | { |
166 | struct inode *inode = file->f_path.dentry->d_inode; | 166 | struct inode *inode = file_inode(file); |
167 | loff_t retval; | 167 | loff_t retval; |
168 | 168 | ||
169 | mutex_lock(&inode->i_mutex); | 169 | mutex_lock(&inode->i_mutex); |
@@ -290,7 +290,7 @@ int rw_verify_area(int read_write, struct file *file, loff_t *ppos, size_t count | |||
290 | loff_t pos; | 290 | loff_t pos; |
291 | int retval = -EINVAL; | 291 | int retval = -EINVAL; |
292 | 292 | ||
293 | inode = file->f_path.dentry->d_inode; | 293 | inode = file_inode(file); |
294 | if (unlikely((ssize_t) count < 0)) | 294 | if (unlikely((ssize_t) count < 0)) |
295 | return retval; | 295 | return retval; |
296 | pos = *ppos; | 296 | pos = *ppos; |
@@ -901,8 +901,8 @@ ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, size_t count, | |||
901 | if (!(out.file->f_mode & FMODE_WRITE)) | 901 | if (!(out.file->f_mode & FMODE_WRITE)) |
902 | goto fput_out; | 902 | goto fput_out; |
903 | retval = -EINVAL; | 903 | retval = -EINVAL; |
904 | in_inode = in.file->f_path.dentry->d_inode; | 904 | in_inode = file_inode(in.file); |
905 | out_inode = out.file->f_path.dentry->d_inode; | 905 | out_inode = file_inode(out.file); |
906 | retval = rw_verify_area(WRITE, out.file, &out.file->f_pos, count); | 906 | retval = rw_verify_area(WRITE, out.file, &out.file->f_pos, count); |
907 | if (retval < 0) | 907 | if (retval < 0) |
908 | goto fput_out; | 908 | goto fput_out; |
diff --git a/fs/readdir.c b/fs/readdir.c index 5e69ef533b77..fee38e04fae4 100644 --- a/fs/readdir.c +++ b/fs/readdir.c | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | int vfs_readdir(struct file *file, filldir_t filler, void *buf) | 23 | int vfs_readdir(struct file *file, filldir_t filler, void *buf) |
24 | { | 24 | { |
25 | struct inode *inode = file->f_path.dentry->d_inode; | 25 | struct inode *inode = file_inode(file); |
26 | int res = -ENOTDIR; | 26 | int res = -ENOTDIR; |
27 | if (!file->f_op || !file->f_op->readdir) | 27 | if (!file->f_op || !file->f_op->readdir) |
28 | goto out; | 28 | goto out; |
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c index 50302d6f8895..6165bd4784f6 100644 --- a/fs/reiserfs/file.c +++ b/fs/reiserfs/file.c | |||
@@ -268,7 +268,7 @@ static ssize_t reiserfs_file_write(struct file *file, /* the file we are going t | |||
268 | * new current position before returning. */ | 268 | * new current position before returning. */ |
269 | ) | 269 | ) |
270 | { | 270 | { |
271 | struct inode *inode = file->f_path.dentry->d_inode; // Inode of the file that we are writing to. | 271 | struct inode *inode = file_inode(file); // Inode of the file that we are writing to. |
272 | /* To simplify coding at this time, we store | 272 | /* To simplify coding at this time, we store |
273 | locked pages in array for now */ | 273 | locked pages in array for now */ |
274 | struct reiserfs_transaction_handle th; | 274 | struct reiserfs_transaction_handle th; |
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c index 0c2185042d5f..15cb5fe6b425 100644 --- a/fs/reiserfs/ioctl.c +++ b/fs/reiserfs/ioctl.c | |||
@@ -21,7 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 22 | long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
23 | { | 23 | { |
24 | struct inode *inode = filp->f_path.dentry->d_inode; | 24 | struct inode *inode = file_inode(filp); |
25 | unsigned int flags; | 25 | unsigned int flags; |
26 | int err = 0; | 26 | int err = 0; |
27 | 27 | ||
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c index e60e87035bb3..9cc0740adffa 100644 --- a/fs/reiserfs/procfs.c +++ b/fs/reiserfs/procfs.c | |||
@@ -281,7 +281,7 @@ static int show_oidmap(struct seq_file *m, struct super_block *sb) | |||
281 | } | 281 | } |
282 | #if defined( REISERFS_USE_OIDMAPF ) | 282 | #if defined( REISERFS_USE_OIDMAPF ) |
283 | if (sb_info->oidmap.use_file && (sb_info->oidmap.mapf != NULL)) { | 283 | if (sb_info->oidmap.use_file && (sb_info->oidmap.mapf != NULL)) { |
284 | loff_t size = sb_info->oidmap.mapf->f_path.dentry->d_inode->i_size; | 284 | loff_t size = file_inode(sb_info->oidmap.mapf)->i_size; |
285 | total_used += size / sizeof(reiserfs_oidinterval_d_t); | 285 | total_used += size / sizeof(reiserfs_oidinterval_d_t); |
286 | } | 286 | } |
287 | #endif | 287 | #endif |
diff --git a/fs/romfs/super.c b/fs/romfs/super.c index fd7c5f60b46b..7e8d3a80bdab 100644 --- a/fs/romfs/super.c +++ b/fs/romfs/super.c | |||
@@ -147,7 +147,7 @@ static const struct address_space_operations romfs_aops = { | |||
147 | */ | 147 | */ |
148 | static int romfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | 148 | static int romfs_readdir(struct file *filp, void *dirent, filldir_t filldir) |
149 | { | 149 | { |
150 | struct inode *i = filp->f_dentry->d_inode; | 150 | struct inode *i = file_inode(filp); |
151 | struct romfs_inode ri; | 151 | struct romfs_inode ri; |
152 | unsigned long offset, maxoff; | 152 | unsigned long offset, maxoff; |
153 | int j, ino, nextfh; | 153 | int j, ino, nextfh; |
diff --git a/fs/splice.c b/fs/splice.c index 6909d89d0da5..963213d56403 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -1170,7 +1170,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, | |||
1170 | * randomly drop data for eg socket -> socket splicing. Use the | 1170 | * randomly drop data for eg socket -> socket splicing. Use the |
1171 | * piped splicing for that! | 1171 | * piped splicing for that! |
1172 | */ | 1172 | */ |
1173 | i_mode = in->f_path.dentry->d_inode->i_mode; | 1173 | i_mode = file_inode(in)->i_mode; |
1174 | if (unlikely(!S_ISREG(i_mode) && !S_ISBLK(i_mode))) | 1174 | if (unlikely(!S_ISREG(i_mode) && !S_ISBLK(i_mode))) |
1175 | return -EINVAL; | 1175 | return -EINVAL; |
1176 | 1176 | ||
diff --git a/fs/squashfs/dir.c b/fs/squashfs/dir.c index b381305c9a47..57dc70ebbb19 100644 --- a/fs/squashfs/dir.c +++ b/fs/squashfs/dir.c | |||
@@ -102,7 +102,7 @@ static int get_dir_index_using_offset(struct super_block *sb, | |||
102 | 102 | ||
103 | static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) | 103 | static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) |
104 | { | 104 | { |
105 | struct inode *inode = file->f_dentry->d_inode; | 105 | struct inode *inode = file_inode(file); |
106 | struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; | 106 | struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; |
107 | u64 block = squashfs_i(inode)->start + msblk->directory_table; | 107 | u64 block = squashfs_i(inode)->start + msblk->directory_table; |
108 | int offset = squashfs_i(inode)->offset, length, dir_count, size, | 108 | int offset = squashfs_i(inode)->offset, length, dir_count, size, |
@@ -332,7 +332,7 @@ SYSCALL_DEFINE(sync_file_range)(int fd, loff_t offset, loff_t nbytes, | |||
332 | if (!f.file) | 332 | if (!f.file) |
333 | goto out; | 333 | goto out; |
334 | 334 | ||
335 | i_mode = f.file->f_path.dentry->d_inode->i_mode; | 335 | i_mode = file_inode(f.file)->i_mode; |
336 | ret = -ESPIPE; | 336 | ret = -ESPIPE; |
337 | if (!S_ISREG(i_mode) && !S_ISBLK(i_mode) && !S_ISDIR(i_mode) && | 337 | if (!S_ISREG(i_mode) && !S_ISBLK(i_mode) && !S_ISDIR(i_mode) && |
338 | !S_ISLNK(i_mode)) | 338 | !S_ISLNK(i_mode)) |
diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c index 614b2b544880..2ce9a5db6ab5 100644 --- a/fs/sysfs/bin.c +++ b/fs/sysfs/bin.c | |||
@@ -70,7 +70,7 @@ static ssize_t | |||
70 | read(struct file *file, char __user *userbuf, size_t bytes, loff_t *off) | 70 | read(struct file *file, char __user *userbuf, size_t bytes, loff_t *off) |
71 | { | 71 | { |
72 | struct bin_buffer *bb = file->private_data; | 72 | struct bin_buffer *bb = file->private_data; |
73 | int size = file->f_path.dentry->d_inode->i_size; | 73 | int size = file_inode(file)->i_size; |
74 | loff_t offs = *off; | 74 | loff_t offs = *off; |
75 | int count = min_t(size_t, bytes, PAGE_SIZE); | 75 | int count = min_t(size_t, bytes, PAGE_SIZE); |
76 | char *temp; | 76 | char *temp; |
@@ -140,7 +140,7 @@ static ssize_t write(struct file *file, const char __user *userbuf, | |||
140 | size_t bytes, loff_t *off) | 140 | size_t bytes, loff_t *off) |
141 | { | 141 | { |
142 | struct bin_buffer *bb = file->private_data; | 142 | struct bin_buffer *bb = file->private_data; |
143 | int size = file->f_path.dentry->d_inode->i_size; | 143 | int size = file_inode(file)->i_size; |
144 | loff_t offs = *off; | 144 | loff_t offs = *off; |
145 | int count = min_t(size_t, bytes, PAGE_SIZE); | 145 | int count = min_t(size_t, bytes, PAGE_SIZE); |
146 | char *temp; | 146 | char *temp; |
@@ -469,7 +469,7 @@ void unmap_bin_file(struct sysfs_dirent *attr_sd) | |||
469 | mutex_lock(&sysfs_bin_lock); | 469 | mutex_lock(&sysfs_bin_lock); |
470 | 470 | ||
471 | hlist_for_each_entry(bb, tmp, &attr_sd->s_bin_attr.buffers, list) { | 471 | hlist_for_each_entry(bb, tmp, &attr_sd->s_bin_attr.buffers, list) { |
472 | struct inode *inode = bb->file->f_path.dentry->d_inode; | 472 | struct inode *inode = file_inode(bb->file); |
473 | 473 | ||
474 | unmap_mapping_range(inode->i_mapping, 0, 0, 1); | 474 | unmap_mapping_range(inode->i_mapping, 0, 0, 1); |
475 | } | 475 | } |
diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c index a77c42157620..3799e8dac3eb 100644 --- a/fs/sysv/dir.c +++ b/fs/sysv/dir.c | |||
@@ -68,7 +68,7 @@ static struct page * dir_get_page(struct inode *dir, unsigned long n) | |||
68 | static int sysv_readdir(struct file * filp, void * dirent, filldir_t filldir) | 68 | static int sysv_readdir(struct file * filp, void * dirent, filldir_t filldir) |
69 | { | 69 | { |
70 | unsigned long pos = filp->f_pos; | 70 | unsigned long pos = filp->f_pos; |
71 | struct inode *inode = filp->f_path.dentry->d_inode; | 71 | struct inode *inode = file_inode(filp); |
72 | struct super_block *sb = inode->i_sb; | 72 | struct super_block *sb = inode->i_sb; |
73 | unsigned offset = pos & ~PAGE_CACHE_MASK; | 73 | unsigned offset = pos & ~PAGE_CACHE_MASK; |
74 | unsigned long n = pos >> PAGE_CACHE_SHIFT; | 74 | unsigned long n = pos >> PAGE_CACHE_SHIFT; |
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 8a574776a493..de08c92f2e23 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c | |||
@@ -352,7 +352,7 @@ static int ubifs_readdir(struct file *file, void *dirent, filldir_t filldir) | |||
352 | struct qstr nm; | 352 | struct qstr nm; |
353 | union ubifs_key key; | 353 | union ubifs_key key; |
354 | struct ubifs_dent_node *dent; | 354 | struct ubifs_dent_node *dent; |
355 | struct inode *dir = file->f_path.dentry->d_inode; | 355 | struct inode *dir = file_inode(file); |
356 | struct ubifs_info *c = dir->i_sb->s_fs_info; | 356 | struct ubifs_info *c = dir->i_sb->s_fs_info; |
357 | 357 | ||
358 | dbg_gen("dir ino %lu, f_pos %#llx", dir->i_ino, file->f_pos); | 358 | dbg_gen("dir ino %lu, f_pos %#llx", dir->i_ino, file->f_pos); |
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 5bc77817f382..fa5b347ec729 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c | |||
@@ -1444,7 +1444,7 @@ static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma, | |||
1444 | struct vm_fault *vmf) | 1444 | struct vm_fault *vmf) |
1445 | { | 1445 | { |
1446 | struct page *page = vmf->page; | 1446 | struct page *page = vmf->page; |
1447 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; | 1447 | struct inode *inode = file_inode(vma->vm_file); |
1448 | struct ubifs_info *c = inode->i_sb->s_fs_info; | 1448 | struct ubifs_info *c = inode->i_sb->s_fs_info; |
1449 | struct timespec now = ubifs_current_time(inode); | 1449 | struct timespec now = ubifs_current_time(inode); |
1450 | struct ubifs_budget_req req = { .new_page = 1 }; | 1450 | struct ubifs_budget_req req = { .new_page = 1 }; |
diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c index 1a7e2d8bdbe9..648b143606cc 100644 --- a/fs/ubifs/ioctl.c +++ b/fs/ubifs/ioctl.c | |||
@@ -147,7 +147,7 @@ out_unlock: | |||
147 | long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 147 | long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
148 | { | 148 | { |
149 | int flags, err; | 149 | int flags, err; |
150 | struct inode *inode = file->f_path.dentry->d_inode; | 150 | struct inode *inode = file_inode(file); |
151 | 151 | ||
152 | switch (cmd) { | 152 | switch (cmd) { |
153 | case FS_IOC_GETFLAGS: | 153 | case FS_IOC_GETFLAGS: |
diff --git a/fs/udf/dir.c b/fs/udf/dir.c index eb8bfe2b89a5..b3e93f5e17c3 100644 --- a/fs/udf/dir.c +++ b/fs/udf/dir.c | |||
@@ -186,7 +186,7 @@ out: | |||
186 | 186 | ||
187 | static int udf_readdir(struct file *filp, void *dirent, filldir_t filldir) | 187 | static int udf_readdir(struct file *filp, void *dirent, filldir_t filldir) |
188 | { | 188 | { |
189 | struct inode *dir = filp->f_path.dentry->d_inode; | 189 | struct inode *dir = file_inode(filp); |
190 | int result; | 190 | int result; |
191 | 191 | ||
192 | if (filp->f_pos == 0) { | 192 | if (filp->f_pos == 0) { |
diff --git a/fs/udf/file.c b/fs/udf/file.c index 77b5953eaac8..4257a1f5302a 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c | |||
@@ -139,7 +139,7 @@ static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
139 | { | 139 | { |
140 | ssize_t retval; | 140 | ssize_t retval; |
141 | struct file *file = iocb->ki_filp; | 141 | struct file *file = iocb->ki_filp; |
142 | struct inode *inode = file->f_path.dentry->d_inode; | 142 | struct inode *inode = file_inode(file); |
143 | int err, pos; | 143 | int err, pos; |
144 | size_t count = iocb->ki_left; | 144 | size_t count = iocb->ki_left; |
145 | struct udf_inode_info *iinfo = UDF_I(inode); | 145 | struct udf_inode_info *iinfo = UDF_I(inode); |
@@ -178,7 +178,7 @@ static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
178 | 178 | ||
179 | long udf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 179 | long udf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
180 | { | 180 | { |
181 | struct inode *inode = filp->f_dentry->d_inode; | 181 | struct inode *inode = file_inode(filp); |
182 | long old_block, new_block; | 182 | long old_block, new_block; |
183 | int result = -EINVAL; | 183 | int result = -EINVAL; |
184 | 184 | ||
diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c index dbc90994715a..3a75ca09c506 100644 --- a/fs/ufs/dir.c +++ b/fs/ufs/dir.c | |||
@@ -433,7 +433,7 @@ static int | |||
433 | ufs_readdir(struct file *filp, void *dirent, filldir_t filldir) | 433 | ufs_readdir(struct file *filp, void *dirent, filldir_t filldir) |
434 | { | 434 | { |
435 | loff_t pos = filp->f_pos; | 435 | loff_t pos = filp->f_pos; |
436 | struct inode *inode = filp->f_path.dentry->d_inode; | 436 | struct inode *inode = file_inode(filp); |
437 | struct super_block *sb = inode->i_sb; | 437 | struct super_block *sb = inode->i_sb; |
438 | unsigned int offset = pos & ~PAGE_CACHE_MASK; | 438 | unsigned int offset = pos & ~PAGE_CACHE_MASK; |
439 | unsigned long n = pos >> PAGE_CACHE_SHIFT; | 439 | unsigned long n = pos >> PAGE_CACHE_SHIFT; |
diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c index d0e9c74d3d96..75d854b0c439 100644 --- a/fs/xfs/xfs_dfrag.c +++ b/fs/xfs/xfs_dfrag.c | |||
@@ -78,14 +78,14 @@ xfs_swapext( | |||
78 | goto out_put_tmp_file; | 78 | goto out_put_tmp_file; |
79 | } | 79 | } |
80 | 80 | ||
81 | if (IS_SWAPFILE(f.file->f_path.dentry->d_inode) || | 81 | if (IS_SWAPFILE(file_inode(f.file)) || |
82 | IS_SWAPFILE(tmp.file->f_path.dentry->d_inode)) { | 82 | IS_SWAPFILE(file_inode(tmp.file))) { |
83 | error = XFS_ERROR(EINVAL); | 83 | error = XFS_ERROR(EINVAL); |
84 | goto out_put_tmp_file; | 84 | goto out_put_tmp_file; |
85 | } | 85 | } |
86 | 86 | ||
87 | ip = XFS_I(f.file->f_path.dentry->d_inode); | 87 | ip = XFS_I(file_inode(f.file)); |
88 | tip = XFS_I(tmp.file->f_path.dentry->d_inode); | 88 | tip = XFS_I(file_inode(tmp.file)); |
89 | 89 | ||
90 | if (ip->i_mount != tip->i_mount) { | 90 | if (ip->i_mount != tip->i_mount) { |
91 | error = XFS_ERROR(EINVAL); | 91 | error = XFS_ERROR(EINVAL); |
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 67284edb84d7..f03bf1a456fb 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
@@ -811,7 +811,7 @@ xfs_file_fallocate( | |||
811 | loff_t offset, | 811 | loff_t offset, |
812 | loff_t len) | 812 | loff_t len) |
813 | { | 813 | { |
814 | struct inode *inode = file->f_path.dentry->d_inode; | 814 | struct inode *inode = file_inode(file); |
815 | long error; | 815 | long error; |
816 | loff_t new_size = 0; | 816 | loff_t new_size = 0; |
817 | xfs_flock64_t bf; | 817 | xfs_flock64_t bf; |
@@ -912,7 +912,7 @@ xfs_file_readdir( | |||
912 | void *dirent, | 912 | void *dirent, |
913 | filldir_t filldir) | 913 | filldir_t filldir) |
914 | { | 914 | { |
915 | struct inode *inode = filp->f_path.dentry->d_inode; | 915 | struct inode *inode = file_inode(filp); |
916 | xfs_inode_t *ip = XFS_I(inode); | 916 | xfs_inode_t *ip = XFS_I(inode); |
917 | int error; | 917 | int error; |
918 | size_t bufsize; | 918 | size_t bufsize; |
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index c1c3ef88a260..d681e34c2950 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c | |||
@@ -80,7 +80,7 @@ xfs_find_handle( | |||
80 | f = fdget(hreq->fd); | 80 | f = fdget(hreq->fd); |
81 | if (!f.file) | 81 | if (!f.file) |
82 | return -EBADF; | 82 | return -EBADF; |
83 | inode = f.file->f_path.dentry->d_inode; | 83 | inode = file_inode(f.file); |
84 | } else { | 84 | } else { |
85 | error = user_lpath((const char __user *)hreq->path, &path); | 85 | error = user_lpath((const char __user *)hreq->path, &path); |
86 | if (error) | 86 | if (error) |
@@ -168,7 +168,7 @@ xfs_handle_to_dentry( | |||
168 | /* | 168 | /* |
169 | * Only allow handle opens under a directory. | 169 | * Only allow handle opens under a directory. |
170 | */ | 170 | */ |
171 | if (!S_ISDIR(parfilp->f_path.dentry->d_inode->i_mode)) | 171 | if (!S_ISDIR(file_inode(parfilp)->i_mode)) |
172 | return ERR_PTR(-ENOTDIR); | 172 | return ERR_PTR(-ENOTDIR); |
173 | 173 | ||
174 | if (hlen != sizeof(xfs_handle_t)) | 174 | if (hlen != sizeof(xfs_handle_t)) |
@@ -1334,7 +1334,7 @@ xfs_file_ioctl( | |||
1334 | unsigned int cmd, | 1334 | unsigned int cmd, |
1335 | unsigned long p) | 1335 | unsigned long p) |
1336 | { | 1336 | { |
1337 | struct inode *inode = filp->f_path.dentry->d_inode; | 1337 | struct inode *inode = file_inode(filp); |
1338 | struct xfs_inode *ip = XFS_I(inode); | 1338 | struct xfs_inode *ip = XFS_I(inode); |
1339 | struct xfs_mount *mp = ip->i_mount; | 1339 | struct xfs_mount *mp = ip->i_mount; |
1340 | void __user *arg = (void __user *)p; | 1340 | void __user *arg = (void __user *)p; |
diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c index 1244274a5674..63b8fc432151 100644 --- a/fs/xfs/xfs_ioctl32.c +++ b/fs/xfs/xfs_ioctl32.c | |||
@@ -530,7 +530,7 @@ xfs_file_compat_ioctl( | |||
530 | unsigned cmd, | 530 | unsigned cmd, |
531 | unsigned long p) | 531 | unsigned long p) |
532 | { | 532 | { |
533 | struct inode *inode = filp->f_path.dentry->d_inode; | 533 | struct inode *inode = file_inode(filp); |
534 | struct xfs_inode *ip = XFS_I(inode); | 534 | struct xfs_inode *ip = XFS_I(inode); |
535 | struct xfs_mount *mp = ip->i_mount; | 535 | struct xfs_mount *mp = ip->i_mount; |
536 | void __user *arg = (void __user *)p; | 536 | void __user *arg = (void __user *)p; |