aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-23 17:07:38 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-02-22 23:31:31 -0500
commit496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch)
tree8f4abde793cd7db5bb8fde6d27ebcacd0e54379a
parent57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff)
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--arch/alpha/kernel/srm_env.c2
-rw-r--r--arch/blackfin/kernel/cplbinfo.c2
-rw-r--r--arch/cris/arch-v10/drivers/sync_serial.c8
-rw-r--r--arch/cris/arch-v32/drivers/cryptocop.c3
-rw-r--r--arch/cris/arch-v32/drivers/sync_serial.c8
-rw-r--r--arch/ia64/kernel/salinfo.c6
-rw-r--r--arch/mips/kernel/rtlx.c13
-rw-r--r--arch/mips/kernel/vpe.c2
-rw-r--r--arch/mips/lasat/picvue_proc.c2
-rw-r--r--arch/powerpc/kernel/proc_powerpc.c6
-rw-r--r--arch/powerpc/kernel/rtas_flash.c16
-rw-r--r--arch/powerpc/platforms/cell/spufs/coredump.c4
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c6
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/syscalls.c2
-rw-r--r--arch/powerpc/platforms/pseries/hvCall_inst.c2
-rw-r--r--arch/powerpc/platforms/pseries/scanlog.c8
-rw-r--r--arch/s390/hypfs/hypfs_dbfs.c2
-rw-r--r--arch/s390/hypfs/inode.c2
-rw-r--r--arch/s390/kernel/debug.c2
-rw-r--r--arch/s390/pci/pci_debug.c4
-rw-r--r--arch/sh/mm/alignment.c2
-rw-r--r--arch/x86/ia32/ia32_aout.c6
-rw-r--r--arch/x86/kernel/cpuid.c4
-rw-r--r--drivers/block/DAC960.c2
-rw-r--r--drivers/block/nbd.c2
-rw-r--r--drivers/char/dsp56k.c8
-rw-r--r--drivers/char/dtlk.c4
-rw-r--r--drivers/char/lp.c8
-rw-r--r--drivers/char/mem.c4
-rw-r--r--drivers/char/nsc_gpio.c4
-rw-r--r--drivers/char/pcmcia/cm4000_cs.c2
-rw-r--r--drivers/char/ppdev.c6
-rw-r--r--drivers/char/ps3flash.c2
-rw-r--r--drivers/char/raw.c2
-rw-r--r--drivers/char/sonypi.c2
-rw-r--r--drivers/char/tb0219.c4
-rw-r--r--drivers/gpu/drm/gma500/gtt.c2
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c10
-rw-r--r--drivers/gpu/drm/ttm/ttm_tt.c4
-rw-r--r--drivers/gpu/drm/udl/udl_gem.c2
-rw-r--r--drivers/hid/hid-roccat.c2
-rw-r--r--drivers/hid/hidraw.c6
-rw-r--r--drivers/i2c/i2c-dev.c4
-rw-r--r--drivers/ide/ide-proc.c4
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c2
-rw-r--r--drivers/infiniband/hw/ipath/ipath_file_ops.c4
-rw-r--r--drivers/infiniband/hw/ipath/ipath_fs.c6
-rw-r--r--drivers/infiniband/hw/qib/qib_file_ops.c2
-rw-r--r--drivers/infiniband/hw/qib/qib_fs.c4
-rw-r--r--drivers/iommu/tegra-smmu.c4
-rw-r--r--drivers/isdn/hardware/eicon/divasproc.c6
-rw-r--r--drivers/isdn/hysdn/hysdn_proclog.c4
-rw-r--r--drivers/isdn/i4l/isdn_common.c8
-rw-r--r--drivers/isdn/i4l/isdn_ppp.c2
-rw-r--r--drivers/md/bitmap.c4
-rw-r--r--drivers/media/pci/zoran/zoran_procfs.c2
-rw-r--r--drivers/media/rc/lirc_dev.c14
-rw-r--r--drivers/media/v4l2-core/v4l2-dev.c2
-rw-r--r--drivers/mtd/ubi/cdev.c2
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c2
-rw-r--r--drivers/net/wan/cosa.c4
-rw-r--r--drivers/net/wireless/ray_cs.c2
-rw-r--r--drivers/parisc/led.c2
-rw-r--r--drivers/pci/proc.c10
-rw-r--r--drivers/platform/x86/sony-laptop.c2
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c2
-rw-r--r--drivers/platform/x86/toshiba_acpi.c8
-rw-r--r--drivers/pnp/isapnp/proc.c4
-rw-r--r--drivers/pnp/pnpbios/proc.c2
-rw-r--r--drivers/s390/char/fs3270.c4
-rw-r--r--drivers/s390/char/tape_char.c8
-rw-r--r--drivers/s390/char/vmur.c2
-rw-r--r--drivers/s390/cio/qdio_debug.c4
-rw-r--r--drivers/sbus/char/display7seg.c2
-rw-r--r--drivers/scsi/3w-9xxx.c2
-rw-r--r--drivers/scsi/3w-sas.c2
-rw-r--r--drivers/scsi/3w-xxxx.c2
-rw-r--r--drivers/scsi/csiostor/csio_init.c2
-rw-r--r--drivers/scsi/dpt_i2o.c4
-rw-r--r--drivers/scsi/st.c2
-rw-r--r--drivers/staging/bcm/Misc.c2
-rw-r--r--drivers/staging/ccg/f_mass_storage.c2
-rw-r--r--drivers/staging/ccg/rndis.c2
-rw-r--r--drivers/staging/ccg/storage_common.c2
-rw-r--r--drivers/staging/dgrp/dgrp_specproc.c4
-rw-r--r--drivers/staging/omapdrm/omap_gem_helpers.c2
-rw-r--r--drivers/staging/usbip/usbip_common.c2
-rw-r--r--drivers/staging/vme/devices/vme_user.c8
-rw-r--r--drivers/target/target_core_file.c2
-rw-r--r--drivers/tty/vt/vc_screen.c8
-rw-r--r--drivers/usb/core/devices.c4
-rw-r--r--drivers/usb/core/devio.c6
-rw-r--r--drivers/usb/gadget/atmel_usba_udc.c8
-rw-r--r--drivers/usb/gadget/f_mass_storage.c2
-rw-r--r--drivers/usb/gadget/printer.c2
-rw-r--r--drivers/usb/gadget/rndis.c2
-rw-r--r--drivers/usb/gadget/storage_common.c2
-rw-r--r--drivers/video/fb_defio.c2
-rw-r--r--drivers/video/fbmem.c2
-rw-r--r--drivers/video/msm/mdp.c2
-rw-r--r--drivers/watchdog/cpwd.c4
-rw-r--r--drivers/zorro/proc.c4
-rw-r--r--fs/9p/vfs_file.c10
-rw-r--r--fs/adfs/dir.c2
-rw-r--r--fs/affs/dir.c2
-rw-r--r--fs/afs/dir.c4
-rw-r--r--fs/afs/flock.c4
-rw-r--r--fs/afs/write.c7
-rw-r--r--fs/autofs4/autofs_i.h2
-rw-r--r--fs/autofs4/dev-ioctl.c2
-rw-r--r--fs/autofs4/root.c4
-rw-r--r--fs/befs/linuxvfs.c2
-rw-r--r--fs/bfs/dir.c2
-rw-r--r--fs/binfmt_aout.c4
-rw-r--r--fs/binfmt_elf.c2
-rw-r--r--fs/binfmt_elf_fdpic.c4
-rw-r--r--fs/binfmt_flat.c2
-rw-r--r--fs/binfmt_misc.c4
-rw-r--r--fs/block_dev.c2
-rw-r--r--fs/btrfs/file.c8
-rw-r--r--fs/btrfs/inode.c4
-rw-r--r--fs/btrfs/ioctl.c52
-rw-r--r--fs/btrfs/send.c2
-rw-r--r--fs/buffer.c4
-rw-r--r--fs/ceph/addr.c12
-rw-r--r--fs/ceph/dir.c6
-rw-r--r--fs/ceph/file.c10
-rw-r--r--fs/ceph/ioctl.c16
-rw-r--r--fs/ceph/locks.c2
-rw-r--r--fs/cifs/cifsfs.c6
-rw-r--r--fs/cifs/file.c26
-rw-r--r--fs/cifs/inode.c8
-rw-r--r--fs/cifs/ioctl.c2
-rw-r--r--fs/cifs/readdir.c4
-rw-r--r--fs/coda/dir.c2
-rw-r--r--fs/coda/file.c12
-rw-r--r--fs/coda/inode.c2
-rw-r--r--fs/coda/pioctl.c2
-rw-r--r--fs/compat_ioctl.c2
-rw-r--r--fs/configfs/dir.c2
-rw-r--r--fs/coredump.c4
-rw-r--r--fs/cramfs/inode.c2
-rw-r--r--fs/ecryptfs/file.c4
-rw-r--r--fs/efs/dir.c2
-rw-r--r--fs/exec.c8
-rw-r--r--fs/exofs/dir.c2
-rw-r--r--fs/ext2/dir.c2
-rw-r--r--fs/ext2/ioctl.c2
-rw-r--r--fs/ext3/dir.c8
-rw-r--r--fs/ext3/ioctl.c2
-rw-r--r--fs/ext3/namei.c4
-rw-r--r--fs/ext4/dir.c8
-rw-r--r--fs/ext4/extents.c4
-rw-r--r--fs/ext4/file.c2
-rw-r--r--fs/ext4/inline.c2
-rw-r--r--fs/ext4/inode.c6
-rw-r--r--fs/ext4/ioctl.c2
-rw-r--r--fs/ext4/move_extent.c6
-rw-r--r--fs/ext4/namei.c2
-rw-r--r--fs/ext4/super.c2
-rw-r--r--fs/f2fs/dir.c2
-rw-r--r--fs/fat/dir.c6
-rw-r--r--fs/fat/file.c4
-rw-r--r--fs/fcntl.c2
-rw-r--r--fs/file_table.c2
-rw-r--r--fs/freevxfs/vxfs_lookup.c2
-rw-r--r--fs/fuse/control.c2
-rw-r--r--fs/fuse/dir.c2
-rw-r--r--fs/gfs2/file.c17
-rw-r--r--fs/gfs2/rgrp.c2
-rw-r--r--fs/hfs/dir.c2
-rw-r--r--fs/hfs/inode.c2
-rw-r--r--fs/hfsplus/dir.c2
-rw-r--r--fs/hfsplus/inode.c2
-rw-r--r--fs/hfsplus/ioctl.c4
-rw-r--r--fs/hostfs/hostfs_kern.c2
-rw-r--r--fs/hpfs/dir.c4
-rw-r--r--fs/hpfs/file.c2
-rw-r--r--fs/hppfs/hppfs.c8
-rw-r--r--fs/hugetlbfs/inode.c2
-rw-r--r--fs/inode.c2
-rw-r--r--fs/ioctl.c12
-rw-r--r--fs/isofs/compress.c2
-rw-r--r--fs/isofs/dir.c2
-rw-r--r--fs/jffs2/dir.c4
-rw-r--r--fs/jfs/ioctl.c2
-rw-r--r--fs/jfs/jfs_dtree.c2
-rw-r--r--fs/lockd/clntlock.c2
-rw-r--r--fs/lockd/clntproc.c2
-rw-r--r--fs/lockd/svclock.c16
-rw-r--r--fs/lockd/svcsubs.c2
-rw-r--r--fs/locks.c24
-rw-r--r--fs/logfs/dir.c4
-rw-r--r--fs/logfs/file.c2
-rw-r--r--fs/minix/dir.c2
-rw-r--r--fs/namei.c2
-rw-r--r--fs/namespace.c2
-rw-r--r--fs/ncpfs/inode.c4
-rw-r--r--fs/ncpfs/ioctl.c2
-rw-r--r--fs/ncpfs/mmap.c2
-rw-r--r--fs/nfs/dir.c8
-rw-r--r--fs/nfs/file.c2
-rw-r--r--fs/nfs/idmap.c2
-rw-r--r--fs/nfs/inode.c4
-rw-r--r--fs/nfs/nfs3proc.c2
-rw-r--r--fs/nfs/nfs4file.c2
-rw-r--r--fs/nfs/proc.c2
-rw-r--r--fs/nfsd/fault_inject.c6
-rw-r--r--fs/nfsd/nfsctl.c2
-rw-r--r--fs/nfsd/vfs.c6
-rw-r--r--fs/nilfs2/dir.c2
-rw-r--r--fs/nilfs2/file.c2
-rw-r--r--fs/nilfs2/ioctl.c2
-rw-r--r--fs/notify/dnotify/dnotify.c4
-rw-r--r--fs/notify/fanotify/fanotify_user.c2
-rw-r--r--fs/ntfs/dir.c2
-rw-r--r--fs/ocfs2/aops.c4
-rw-r--r--fs/ocfs2/dir.c2
-rw-r--r--fs/ocfs2/dlmfs/dlmfs.c6
-rw-r--r--fs/ocfs2/file.c10
-rw-r--r--fs/ocfs2/ioctl.c4
-rw-r--r--fs/ocfs2/mmap.c8
-rw-r--r--fs/ocfs2/move_extents.c2
-rw-r--r--fs/ocfs2/refcounttree.c4
-rw-r--r--fs/omfs/dir.c4
-rw-r--r--fs/open.c6
-rw-r--r--fs/openpromfs/inode.c2
-rw-r--r--fs/pipe.c16
-rw-r--r--fs/proc/base.c38
-rw-r--r--fs/proc/generic.c10
-rw-r--r--fs/proc/inode.c14
-rw-r--r--fs/proc/nommu.c2
-rw-r--r--fs/proc/proc_net.c2
-rw-r--r--fs/proc/proc_sysctl.c4
-rw-r--r--fs/proc/task_mmu.c6
-rw-r--r--fs/proc/task_nommu.c2
-rw-r--r--fs/qnx4/dir.c2
-rw-r--r--fs/qnx6/dir.c2
-rw-r--r--fs/ramfs/file-nommu.c2
-rw-r--r--fs/read_write.c8
-rw-r--r--fs/readdir.c2
-rw-r--r--fs/reiserfs/file.c2
-rw-r--r--fs/reiserfs/ioctl.c2
-rw-r--r--fs/reiserfs/procfs.c2
-rw-r--r--fs/romfs/super.c2
-rw-r--r--fs/splice.c2
-rw-r--r--fs/squashfs/dir.c2
-rw-r--r--fs/sync.c2
-rw-r--r--fs/sysfs/bin.c6
-rw-r--r--fs/sysv/dir.c2
-rw-r--r--fs/ubifs/dir.c2
-rw-r--r--fs/ubifs/file.c2
-rw-r--r--fs/ubifs/ioctl.c2
-rw-r--r--fs/udf/dir.c2
-rw-r--r--fs/udf/file.c4
-rw-r--r--fs/ufs/dir.c2
-rw-r--r--fs/xfs/xfs_dfrag.c8
-rw-r--r--fs/xfs/xfs_file.c4
-rw-r--r--fs/xfs/xfs_ioctl.c6
-rw-r--r--fs/xfs/xfs_ioctl32.c2
-rw-r--r--include/linux/fs.h9
-rw-r--r--include/linux/fsnotify.h2
-rw-r--r--include/linux/hugetlb.h2
-rw-r--r--include/linux/lockd/lockd.h2
-rw-r--r--ipc/mqueue.c16
-rw-r--r--ipc/shm.c8
-rw-r--r--kernel/acct.c2
-rw-r--r--kernel/cgroup.c6
-rw-r--r--kernel/events/core.c2
-rw-r--r--kernel/fork.c2
-rw-r--r--kernel/irq/proc.c2
-rw-r--r--kernel/nsproxy.c2
-rw-r--r--kernel/relay.c4
-rw-r--r--kernel/sys.c8
-rw-r--r--mm/fadvise.c2
-rw-r--r--mm/filemap.c2
-rw-r--r--mm/hugetlb.c4
-rw-r--r--mm/mmap.c8
-rw-r--r--mm/nommu.c12
-rw-r--r--mm/shmem.c12
-rw-r--r--mm/swapfile.c2
-rw-r--r--net/atm/proc.c2
-rw-r--r--net/core/net_namespace.c2
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c2
-rw-r--r--net/netfilter/xt_recent.c2
-rw-r--r--net/netlink/af_netlink.c2
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c2
-rw-r--r--net/sunrpc/cache.c28
-rw-r--r--net/sunrpc/rpc_pipe.c10
-rw-r--r--net/unix/garbage.c2
-rw-r--r--security/apparmor/domain.c4
-rw-r--r--security/apparmor/file.c4
-rw-r--r--security/apparmor/lsm.c6
-rw-r--r--security/integrity/ima/ima_api.c6
-rw-r--r--security/integrity/ima/ima_crypto.c2
-rw-r--r--security/integrity/ima/ima_main.c4
-rw-r--r--security/selinux/hooks.c10
-rw-r--r--security/selinux/selinuxfs.c20
-rw-r--r--security/smack/smack_lsm.c14
-rw-r--r--security/tomoyo/securityfs_if.c2
-rw-r--r--sound/core/info.c2
-rw-r--r--sound/core/pcm_native.c2
-rw-r--r--sound/oss/msnd_pinnacle.c6
-rw-r--r--sound/oss/soundcard.c10
-rw-r--r--sound/sound_firmware.c2
306 files changed, 696 insertions, 717 deletions
diff --git a/arch/alpha/kernel/srm_env.c b/arch/alpha/kernel/srm_env.c
index b9fc6c309d2e..e64559f0a82d 100644
--- a/arch/alpha/kernel/srm_env.c
+++ b/arch/alpha/kernel/srm_env.c
@@ -111,7 +111,7 @@ static ssize_t srm_env_proc_write(struct file *file, const char __user *buffer,
111 size_t count, loff_t *pos) 111 size_t count, loff_t *pos)
112{ 112{
113 int res; 113 int res;
114 srm_env_t *entry = PDE(file->f_path.dentry->d_inode)->data; 114 srm_env_t *entry = PDE(file_inode(file))->data;
115 char *buf = (char *) __get_free_page(GFP_USER); 115 char *buf = (char *) __get_free_page(GFP_USER);
116 unsigned long ret1, ret2; 116 unsigned long ret1, ret2;
117 117
diff --git a/arch/blackfin/kernel/cplbinfo.c b/arch/blackfin/kernel/cplbinfo.c
index 0bdaa517a501..e1d0b24c6070 100644
--- a/arch/blackfin/kernel/cplbinfo.c
+++ b/arch/blackfin/kernel/cplbinfo.c
@@ -116,7 +116,7 @@ static const struct seq_operations cplbinfo_sops = {
116 116
117static int cplbinfo_open(struct inode *inode, struct file *file) 117static int cplbinfo_open(struct inode *inode, struct file *file)
118{ 118{
119 struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 119 struct proc_dir_entry *pde = PDE(file_inode(file));
120 char cplb_type; 120 char cplb_type;
121 unsigned int cpu; 121 unsigned int cpu;
122 int ret; 122 int ret;
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c
index c4b71710fb0e..a1c498d18d31 100644
--- a/arch/cris/arch-v10/drivers/sync_serial.c
+++ b/arch/cris/arch-v10/drivers/sync_serial.c
@@ -654,7 +654,7 @@ static int sync_serial_release(struct inode *inode, struct file *file)
654 654
655static unsigned int sync_serial_poll(struct file *file, poll_table *wait) 655static unsigned int sync_serial_poll(struct file *file, poll_table *wait)
656{ 656{
657 int dev = MINOR(file->f_dentry->d_inode->i_rdev); 657 int dev = MINOR(file_inode(file)->i_rdev);
658 unsigned int mask = 0; 658 unsigned int mask = 0;
659 struct sync_port *port; 659 struct sync_port *port;
660 DEBUGPOLL(static unsigned int prev_mask = 0); 660 DEBUGPOLL(static unsigned int prev_mask = 0);
@@ -685,7 +685,7 @@ static int sync_serial_ioctl_unlocked(struct file *file,
685 int return_val = 0; 685 int return_val = 0;
686 unsigned long flags; 686 unsigned long flags;
687 687
688 int dev = MINOR(file->f_dentry->d_inode->i_rdev); 688 int dev = MINOR(file_inode(file)->i_rdev);
689 struct sync_port *port; 689 struct sync_port *port;
690 690
691 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) { 691 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) {
@@ -973,7 +973,7 @@ static long sync_serial_ioctl(struct file *file,
973static ssize_t sync_serial_write(struct file *file, const char *buf, 973static ssize_t sync_serial_write(struct file *file, const char *buf,
974 size_t count, loff_t *ppos) 974 size_t count, loff_t *ppos)
975{ 975{
976 int dev = MINOR(file->f_dentry->d_inode->i_rdev); 976 int dev = MINOR(file_inode(file)->i_rdev);
977 DECLARE_WAITQUEUE(wait, current); 977 DECLARE_WAITQUEUE(wait, current);
978 struct sync_port *port; 978 struct sync_port *port;
979 unsigned long flags; 979 unsigned long flags;
@@ -1097,7 +1097,7 @@ static ssize_t sync_serial_write(struct file *file, const char *buf,
1097static ssize_t sync_serial_read(struct file *file, char *buf, 1097static ssize_t sync_serial_read(struct file *file, char *buf,
1098 size_t count, loff_t *ppos) 1098 size_t count, loff_t *ppos)
1099{ 1099{
1100 int dev = MINOR(file->f_dentry->d_inode->i_rdev); 1100 int dev = MINOR(file_inode(file)->i_rdev);
1101 int avail; 1101 int avail;
1102 struct sync_port *port; 1102 struct sync_port *port;
1103 unsigned char *start; 1103 unsigned char *start;
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index f8476d9e856b..877da1908234 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -3135,11 +3135,10 @@ static long cryptocop_ioctl_unlocked(struct inode *inode,
3135static long 3135static long
3136cryptocop_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 3136cryptocop_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
3137{ 3137{
3138 struct inode *inode = file->f_path.dentry->d_inode;
3139 long ret; 3138 long ret;
3140 3139
3141 mutex_lock(&cryptocop_mutex); 3140 mutex_lock(&cryptocop_mutex);
3142 ret = cryptocop_ioctl_unlocked(inode, filp, cmd, arg); 3141 ret = cryptocop_ioctl_unlocked(file_inode(filp), filp, cmd, arg);
3143 mutex_unlock(&cryptocop_mutex); 3142 mutex_unlock(&cryptocop_mutex);
3144 3143
3145 return ret; 3144 return ret;
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c
index a6a180bc566f..219f704e3221 100644
--- a/arch/cris/arch-v32/drivers/sync_serial.c
+++ b/arch/cris/arch-v32/drivers/sync_serial.c
@@ -609,7 +609,7 @@ static int sync_serial_release(struct inode *inode, struct file *file)
609 609
610static unsigned int sync_serial_poll(struct file *file, poll_table *wait) 610static unsigned int sync_serial_poll(struct file *file, poll_table *wait)
611{ 611{
612 int dev = iminor(file->f_path.dentry->d_inode); 612 int dev = iminor(file_inode(file));
613 unsigned int mask = 0; 613 unsigned int mask = 0;
614 sync_port *port; 614 sync_port *port;
615 DEBUGPOLL( static unsigned int prev_mask = 0; ); 615 DEBUGPOLL( static unsigned int prev_mask = 0; );
@@ -657,7 +657,7 @@ static int sync_serial_ioctl(struct file *file,
657{ 657{
658 int return_val = 0; 658 int return_val = 0;
659 int dma_w_size = regk_dma_set_w_size1; 659 int dma_w_size = regk_dma_set_w_size1;
660 int dev = iminor(file->f_path.dentry->d_inode); 660 int dev = iminor(file_inode(file));
661 sync_port *port; 661 sync_port *port;
662 reg_sser_rw_tr_cfg tr_cfg; 662 reg_sser_rw_tr_cfg tr_cfg;
663 reg_sser_rw_rec_cfg rec_cfg; 663 reg_sser_rw_rec_cfg rec_cfg;
@@ -979,7 +979,7 @@ static long sync_serial_ioctl(struct file *file,
979static ssize_t sync_serial_write(struct file *file, const char *buf, 979static ssize_t sync_serial_write(struct file *file, const char *buf,
980 size_t count, loff_t *ppos) 980 size_t count, loff_t *ppos)
981{ 981{
982 int dev = iminor(file->f_path.dentry->d_inode); 982 int dev = iminor(file_inode(file));
983 DECLARE_WAITQUEUE(wait, current); 983 DECLARE_WAITQUEUE(wait, current);
984 struct sync_port *port; 984 struct sync_port *port;
985 int trunc_count; 985 int trunc_count;
@@ -1102,7 +1102,7 @@ static ssize_t sync_serial_write(struct file *file, const char *buf,
1102static ssize_t sync_serial_read(struct file * file, char * buf, 1102static ssize_t sync_serial_read(struct file * file, char * buf,
1103 size_t count, loff_t *ppos) 1103 size_t count, loff_t *ppos)
1104{ 1104{
1105 int dev = iminor(file->f_path.dentry->d_inode); 1105 int dev = iminor(file_inode(file));
1106 int avail; 1106 int avail;
1107 sync_port *port; 1107 sync_port *port;
1108 unsigned char* start; 1108 unsigned char* start;
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
index 79802e540e53..aa527d7e91f2 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@ -301,7 +301,7 @@ salinfo_event_open(struct inode *inode, struct file *file)
301static ssize_t 301static ssize_t
302salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) 302salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
303{ 303{
304 struct inode *inode = file->f_path.dentry->d_inode; 304 struct inode *inode = file_inode(file);
305 struct proc_dir_entry *entry = PDE(inode); 305 struct proc_dir_entry *entry = PDE(inode);
306 struct salinfo_data *data = entry->data; 306 struct salinfo_data *data = entry->data;
307 char cmd[32]; 307 char cmd[32];
@@ -463,7 +463,7 @@ retry:
463static ssize_t 463static ssize_t
464salinfo_log_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) 464salinfo_log_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
465{ 465{
466 struct inode *inode = file->f_path.dentry->d_inode; 466 struct inode *inode = file_inode(file);
467 struct proc_dir_entry *entry = PDE(inode); 467 struct proc_dir_entry *entry = PDE(inode);
468 struct salinfo_data *data = entry->data; 468 struct salinfo_data *data = entry->data;
469 u8 *buf; 469 u8 *buf;
@@ -524,7 +524,7 @@ salinfo_log_clear(struct salinfo_data *data, int cpu)
524static ssize_t 524static ssize_t
525salinfo_log_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) 525salinfo_log_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
526{ 526{
527 struct inode *inode = file->f_path.dentry->d_inode; 527 struct inode *inode = file_inode(file);
528 struct proc_dir_entry *entry = PDE(inode); 528 struct proc_dir_entry *entry = PDE(inode);
529 struct salinfo_data *data = entry->data; 529 struct salinfo_data *data = entry->data;
530 char cmd[32]; 530 char cmd[32];
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index b8c18dcdd2c4..88f7b50d541c 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -399,11 +399,9 @@ static int file_release(struct inode *inode, struct file *filp)
399 399
400static unsigned int file_poll(struct file *file, poll_table * wait) 400static unsigned int file_poll(struct file *file, poll_table * wait)
401{ 401{
402 int minor; 402 int minor = iminor(file_inode(file));
403 unsigned int mask = 0; 403 unsigned int mask = 0;
404 404
405 minor = iminor(file->f_path.dentry->d_inode);
406
407 poll_wait(file, &channel_wqs[minor].rt_queue, wait); 405 poll_wait(file, &channel_wqs[minor].rt_queue, wait);
408 poll_wait(file, &channel_wqs[minor].lx_queue, wait); 406 poll_wait(file, &channel_wqs[minor].lx_queue, wait);
409 407
@@ -424,7 +422,7 @@ static unsigned int file_poll(struct file *file, poll_table * wait)
424static ssize_t file_read(struct file *file, char __user * buffer, size_t count, 422static ssize_t file_read(struct file *file, char __user * buffer, size_t count,
425 loff_t * ppos) 423 loff_t * ppos)
426{ 424{
427 int minor = iminor(file->f_path.dentry->d_inode); 425 int minor = iminor(file_inode(file));
428 426
429 /* data available? */ 427 /* data available? */
430 if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) { 428 if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) {
@@ -437,11 +435,8 @@ static ssize_t file_read(struct file *file, char __user * buffer, size_t count,
437static ssize_t file_write(struct file *file, const char __user * buffer, 435static ssize_t file_write(struct file *file, const char __user * buffer,
438 size_t count, loff_t * ppos) 436 size_t count, loff_t * ppos)
439{ 437{
440 int minor; 438 int minor = iminor(file_inode(file));
441 struct rtlx_channel *rt; 439 struct rtlx_channel *rt = &rtlx->channel[minor];
442
443 minor = iminor(file->f_path.dentry->d_inode);
444 rt = &rtlx->channel[minor];
445 440
446 /* any space left... */ 441 /* any space left... */
447 if (!rtlx_write_poll(minor)) { 442 if (!rtlx_write_poll(minor)) {
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index eec690af6581..d75a5289d9b3 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -1149,7 +1149,7 @@ static ssize_t vpe_write(struct file *file, const char __user * buffer,
1149 size_t ret = count; 1149 size_t ret = count;
1150 struct vpe *v; 1150 struct vpe *v;
1151 1151
1152 if (iminor(file->f_path.dentry->d_inode) != minor) 1152 if (iminor(file_inode(file)) != minor)
1153 return -ENODEV; 1153 return -ENODEV;
1154 1154
1155 v = get_vpe(tclimit); 1155 v = get_vpe(tclimit);
diff --git a/arch/mips/lasat/picvue_proc.c b/arch/mips/lasat/picvue_proc.c
index 8e388da1926f..c592bc8b8c99 100644
--- a/arch/mips/lasat/picvue_proc.c
+++ b/arch/mips/lasat/picvue_proc.c
@@ -64,7 +64,7 @@ static int pvc_line_proc_open(struct inode *inode, struct file *file)
64static ssize_t pvc_line_proc_write(struct file *file, const char __user *buf, 64static ssize_t pvc_line_proc_write(struct file *file, const char __user *buf,
65 size_t count, loff_t *pos) 65 size_t count, loff_t *pos)
66{ 66{
67 int lineno = *(int *)PDE(file->f_path.dentry->d_inode)->data; 67 int lineno = *(int *)PDE(file_inode(file))->data;
68 char kbuf[PVC_LINELEN]; 68 char kbuf[PVC_LINELEN];
69 size_t len; 69 size_t len;
70 70
diff --git a/arch/powerpc/kernel/proc_powerpc.c b/arch/powerpc/kernel/proc_powerpc.c
index c8ae3714e79b..f19d0bdc3241 100644
--- a/arch/powerpc/kernel/proc_powerpc.c
+++ b/arch/powerpc/kernel/proc_powerpc.c
@@ -32,7 +32,7 @@
32static loff_t page_map_seek( struct file *file, loff_t off, int whence) 32static loff_t page_map_seek( struct file *file, loff_t off, int whence)
33{ 33{
34 loff_t new; 34 loff_t new;
35 struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); 35 struct proc_dir_entry *dp = PDE(file_inode(file));
36 36
37 switch(whence) { 37 switch(whence) {
38 case 0: 38 case 0:
@@ -55,13 +55,13 @@ static loff_t page_map_seek( struct file *file, loff_t off, int whence)
55static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes, 55static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes,
56 loff_t *ppos) 56 loff_t *ppos)
57{ 57{
58 struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); 58 struct proc_dir_entry *dp = PDE(file_inode(file));
59 return simple_read_from_buffer(buf, nbytes, ppos, dp->data, dp->size); 59 return simple_read_from_buffer(buf, nbytes, ppos, dp->data, dp->size);
60} 60}
61 61
62static int page_map_mmap( struct file *file, struct vm_area_struct *vma ) 62static int page_map_mmap( struct file *file, struct vm_area_struct *vma )
63{ 63{
64 struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); 64 struct proc_dir_entry *dp = PDE(file_inode(file));
65 65
66 if ((vma->vm_end - vma->vm_start) > dp->size) 66 if ((vma->vm_end - vma->vm_start) > dp->size)
67 return -EINVAL; 67 return -EINVAL;
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c
index 8329190312c1..c642f0132988 100644
--- a/arch/powerpc/kernel/rtas_flash.c
+++ b/arch/powerpc/kernel/rtas_flash.c
@@ -191,7 +191,7 @@ static void free_flash_list(struct flash_block_list *f)
191 191
192static int rtas_flash_release(struct inode *inode, struct file *file) 192static int rtas_flash_release(struct inode *inode, struct file *file)
193{ 193{
194 struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); 194 struct proc_dir_entry *dp = PDE(file_inode(file));
195 struct rtas_update_flash_t *uf; 195 struct rtas_update_flash_t *uf;
196 196
197 uf = (struct rtas_update_flash_t *) dp->data; 197 uf = (struct rtas_update_flash_t *) dp->data;
@@ -253,7 +253,7 @@ static void get_flash_status_msg(int status, char *buf)
253static ssize_t rtas_flash_read(struct file *file, char __user *buf, 253static ssize_t rtas_flash_read(struct file *file, char __user *buf,
254 size_t count, loff_t *ppos) 254 size_t count, loff_t *ppos)
255{ 255{
256 struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); 256 struct proc_dir_entry *dp = PDE(file_inode(file));
257 struct rtas_update_flash_t *uf; 257 struct rtas_update_flash_t *uf;
258 char msg[RTAS_MSG_MAXLEN]; 258 char msg[RTAS_MSG_MAXLEN];
259 259
@@ -282,7 +282,7 @@ void rtas_block_ctor(void *ptr)
282static ssize_t rtas_flash_write(struct file *file, const char __user *buffer, 282static ssize_t rtas_flash_write(struct file *file, const char __user *buffer,
283 size_t count, loff_t *off) 283 size_t count, loff_t *off)
284{ 284{
285 struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); 285 struct proc_dir_entry *dp = PDE(file_inode(file));
286 struct rtas_update_flash_t *uf; 286 struct rtas_update_flash_t *uf;
287 char *p; 287 char *p;
288 int next_free; 288 int next_free;
@@ -374,7 +374,7 @@ static void manage_flash(struct rtas_manage_flash_t *args_buf)
374static ssize_t manage_flash_read(struct file *file, char __user *buf, 374static ssize_t manage_flash_read(struct file *file, char __user *buf,
375 size_t count, loff_t *ppos) 375 size_t count, loff_t *ppos)
376{ 376{
377 struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); 377 struct proc_dir_entry *dp = PDE(file_inode(file));
378 struct rtas_manage_flash_t *args_buf; 378 struct rtas_manage_flash_t *args_buf;
379 char msg[RTAS_MSG_MAXLEN]; 379 char msg[RTAS_MSG_MAXLEN];
380 int msglen; 380 int msglen;
@@ -391,7 +391,7 @@ static ssize_t manage_flash_read(struct file *file, char __user *buf,
391static ssize_t manage_flash_write(struct file *file, const char __user *buf, 391static ssize_t manage_flash_write(struct file *file, const char __user *buf,
392 size_t count, loff_t *off) 392 size_t count, loff_t *off)
393{ 393{
394 struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); 394 struct proc_dir_entry *dp = PDE(file_inode(file));
395 struct rtas_manage_flash_t *args_buf; 395 struct rtas_manage_flash_t *args_buf;
396 const char reject_str[] = "0"; 396 const char reject_str[] = "0";
397 const char commit_str[] = "1"; 397 const char commit_str[] = "1";
@@ -462,7 +462,7 @@ static int get_validate_flash_msg(struct rtas_validate_flash_t *args_buf,
462static ssize_t validate_flash_read(struct file *file, char __user *buf, 462static ssize_t validate_flash_read(struct file *file, char __user *buf,
463 size_t count, loff_t *ppos) 463 size_t count, loff_t *ppos)
464{ 464{
465 struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); 465 struct proc_dir_entry *dp = PDE(file_inode(file));
466 struct rtas_validate_flash_t *args_buf; 466 struct rtas_validate_flash_t *args_buf;
467 char msg[RTAS_MSG_MAXLEN]; 467 char msg[RTAS_MSG_MAXLEN];
468 int msglen; 468 int msglen;
@@ -477,7 +477,7 @@ static ssize_t validate_flash_read(struct file *file, char __user *buf,
477static ssize_t validate_flash_write(struct file *file, const char __user *buf, 477static ssize_t validate_flash_write(struct file *file, const char __user *buf,
478 size_t count, loff_t *off) 478 size_t count, loff_t *off)
479{ 479{
480 struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); 480 struct proc_dir_entry *dp = PDE(file_inode(file));
481 struct rtas_validate_flash_t *args_buf; 481 struct rtas_validate_flash_t *args_buf;
482 int rc; 482 int rc;
483 483
@@ -526,7 +526,7 @@ done:
526 526
527static int validate_flash_release(struct inode *inode, struct file *file) 527static int validate_flash_release(struct inode *inode, struct file *file)
528{ 528{
529 struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); 529 struct proc_dir_entry *dp = PDE(file_inode(file));
530 struct rtas_validate_flash_t *args_buf; 530 struct rtas_validate_flash_t *args_buf;
531 531
532 args_buf = (struct rtas_validate_flash_t *) dp->data; 532 args_buf = (struct rtas_validate_flash_t *) dp->data;
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index 657e3f233a64..c9500ea7be2f 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -111,7 +111,7 @@ static int match_context(const void *v, struct file *file, unsigned fd)
111 struct spu_context *ctx; 111 struct spu_context *ctx;
112 if (file->f_op != &spufs_context_fops) 112 if (file->f_op != &spufs_context_fops)
113 return 0; 113 return 0;
114 ctx = SPUFS_I(file->f_dentry->d_inode)->i_ctx; 114 ctx = SPUFS_I(file_inode(file))->i_ctx;
115 if (ctx->flags & SPU_CREATE_NOSCHED) 115 if (ctx->flags & SPU_CREATE_NOSCHED)
116 return 0; 116 return 0;
117 return fd + 1; 117 return fd + 1;
@@ -137,7 +137,7 @@ static struct spu_context *coredump_next_context(int *fd)
137 return NULL; 137 return NULL;
138 *fd = n - 1; 138 *fd = n - 1;
139 file = fcheck(*fd); 139 file = fcheck(*fd);
140 return SPUFS_I(file->f_dentry->d_inode)->i_ctx; 140 return SPUFS_I(file_inode(file))->i_ctx;
141} 141}
142 142
143int spufs_coredump_extra_notes_size(void) 143int spufs_coredump_extra_notes_size(void)
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 0cfece4cf6ef..68c57d38745a 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -1852,7 +1852,7 @@ out:
1852 1852
1853static int spufs_mfc_fsync(struct file *file, loff_t start, loff_t end, int datasync) 1853static int spufs_mfc_fsync(struct file *file, loff_t start, loff_t end, int datasync)
1854{ 1854{
1855 struct inode *inode = file->f_path.dentry->d_inode; 1855 struct inode *inode = file_inode(file);
1856 int err = filemap_write_and_wait_range(inode->i_mapping, start, end); 1856 int err = filemap_write_and_wait_range(inode->i_mapping, start, end);
1857 if (!err) { 1857 if (!err) {
1858 mutex_lock(&inode->i_mutex); 1858 mutex_lock(&inode->i_mutex);
@@ -2501,7 +2501,7 @@ static int switch_log_sprint(struct spu_context *ctx, char *tbuf, int n)
2501static ssize_t spufs_switch_log_read(struct file *file, char __user *buf, 2501static ssize_t spufs_switch_log_read(struct file *file, char __user *buf,
2502 size_t len, loff_t *ppos) 2502 size_t len, loff_t *ppos)
2503{ 2503{
2504 struct inode *inode = file->f_path.dentry->d_inode; 2504 struct inode *inode = file_inode(file);
2505 struct spu_context *ctx = SPUFS_I(inode)->i_ctx; 2505 struct spu_context *ctx = SPUFS_I(inode)->i_ctx;
2506 int error = 0, cnt = 0; 2506 int error = 0, cnt = 0;
2507 2507
@@ -2571,7 +2571,7 @@ static ssize_t spufs_switch_log_read(struct file *file, char __user *buf,
2571 2571
2572static unsigned int spufs_switch_log_poll(struct file *file, poll_table *wait) 2572static unsigned int spufs_switch_log_poll(struct file *file, poll_table *wait)
2573{ 2573{
2574 struct inode *inode = file->f_path.dentry->d_inode; 2574 struct inode *inode = file_inode(file);
2575 struct spu_context *ctx = SPUFS_I(inode)->i_ctx; 2575 struct spu_context *ctx = SPUFS_I(inode)->i_ctx;
2576 unsigned int mask = 0; 2576 unsigned int mask = 0;
2577 int rc; 2577 int rc;
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index dba1ce235da5..99db6161e5c9 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -368,7 +368,7 @@ spufs_assert_affinity(unsigned int flags, struct spu_gang *gang,
368 return ERR_PTR(-EINVAL); 368 return ERR_PTR(-EINVAL);
369 369
370 neighbor = get_spu_context( 370 neighbor = get_spu_context(
371 SPUFS_I(filp->f_dentry->d_inode)->i_ctx); 371 SPUFS_I(file_inode(filp))->i_ctx);
372 372
373 if (!list_empty(&neighbor->aff_list) && !(neighbor->aff_head) && 373 if (!list_empty(&neighbor->aff_list) && !(neighbor->aff_head) &&
374 !list_is_last(&neighbor->aff_list, &gang->aff_list_head) && 374 !list_is_last(&neighbor->aff_list, &gang->aff_list_head) &&
diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/platforms/cell/spufs/syscalls.c
index baee994fe810..b045fdda4845 100644
--- a/arch/powerpc/platforms/cell/spufs/syscalls.c
+++ b/arch/powerpc/platforms/cell/spufs/syscalls.c
@@ -47,7 +47,7 @@ static long do_spu_run(struct file *filp,
47 if (filp->f_op != &spufs_context_fops) 47 if (filp->f_op != &spufs_context_fops)
48 goto out; 48 goto out;
49 49
50 i = SPUFS_I(filp->f_path.dentry->d_inode); 50 i = SPUFS_I(file_inode(filp));
51 ret = spufs_run_spu(i->i_ctx, &npc, &status); 51 ret = spufs_run_spu(i->i_ctx, &npc, &status);
52 52
53 if (put_user(npc, unpc)) 53 if (put_user(npc, unpc))
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c
index c9311cfdfcac..cf4e7736e4f1 100644
--- a/arch/powerpc/platforms/pseries/hvCall_inst.c
+++ b/arch/powerpc/platforms/pseries/hvCall_inst.c
@@ -86,7 +86,7 @@ static int hcall_inst_seq_open(struct inode *inode, struct file *file)
86 86
87 rc = seq_open(file, &hcall_inst_seq_ops); 87 rc = seq_open(file, &hcall_inst_seq_ops);
88 seq = file->private_data; 88 seq = file->private_data;
89 seq->private = file->f_path.dentry->d_inode->i_private; 89 seq->private = file_inode(file)->i_private;
90 90
91 return rc; 91 return rc;
92} 92}
diff --git a/arch/powerpc/platforms/pseries/scanlog.c b/arch/powerpc/platforms/pseries/scanlog.c
index 554457294a2b..47f3cda2a68b 100644
--- a/arch/powerpc/platforms/pseries/scanlog.c
+++ b/arch/powerpc/platforms/pseries/scanlog.c
@@ -46,16 +46,12 @@ static struct proc_dir_entry *proc_ppc64_scan_log_dump; /* The proc file */
46static ssize_t scanlog_read(struct file *file, char __user *buf, 46static ssize_t scanlog_read(struct file *file, char __user *buf,
47 size_t count, loff_t *ppos) 47 size_t count, loff_t *ppos)
48{ 48{
49 struct inode * inode = file->f_path.dentry->d_inode; 49 struct proc_dir_entry *dp = PDE(file_inode(file));
50 struct proc_dir_entry *dp; 50 unsigned int *data = (unsigned int *)dp->data;
51 unsigned int *data;
52 int status; 51 int status;
53 unsigned long len, off; 52 unsigned long len, off;
54 unsigned int wait_time; 53 unsigned int wait_time;
55 54
56 dp = PDE(inode);
57 data = (unsigned int *)dp->data;
58
59 if (count > RTAS_DATA_BUF_SIZE) 55 if (count > RTAS_DATA_BUF_SIZE)
60 count = RTAS_DATA_BUF_SIZE; 56 count = RTAS_DATA_BUF_SIZE;
61 57
diff --git a/arch/s390/hypfs/hypfs_dbfs.c b/arch/s390/hypfs/hypfs_dbfs.c
index 13e76dabbe8b..9fd4a40c6752 100644
--- a/arch/s390/hypfs/hypfs_dbfs.c
+++ b/arch/s390/hypfs/hypfs_dbfs.c
@@ -54,7 +54,7 @@ static ssize_t dbfs_read(struct file *file, char __user *buf,
54 if (*ppos != 0) 54 if (*ppos != 0)
55 return 0; 55 return 0;
56 56
57 df = file->f_path.dentry->d_inode->i_private; 57 df = file_inode(file)->i_private;
58 mutex_lock(&df->lock); 58 mutex_lock(&df->lock);
59 if (!df->data) { 59 if (!df->data) {
60 data = hypfs_dbfs_data_alloc(df); 60 data = hypfs_dbfs_data_alloc(df);
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index 06ea69bd387a..280ded8b79ba 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -119,7 +119,7 @@ static void hypfs_evict_inode(struct inode *inode)
119 119
120static int hypfs_open(struct inode *inode, struct file *filp) 120static int hypfs_open(struct inode *inode, struct file *filp)
121{ 121{
122 char *data = filp->f_path.dentry->d_inode->i_private; 122 char *data = file_inode(filp)->i_private;
123 struct hypfs_sb_info *fs_info; 123 struct hypfs_sb_info *fs_info;
124 124
125 if (filp->f_mode & FMODE_WRITE) { 125 if (filp->f_mode & FMODE_WRITE) {
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index 4e8215e0d4b6..19dcf136b851 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -611,7 +611,7 @@ debug_open(struct inode *inode, struct file *file)
611 debug_info_t *debug_info, *debug_info_snapshot; 611 debug_info_t *debug_info, *debug_info_snapshot;
612 612
613 mutex_lock(&debug_mutex); 613 mutex_lock(&debug_mutex);
614 debug_info = file->f_path.dentry->d_inode->i_private; 614 debug_info = file_inode(file)->i_private;
615 /* find debug view */ 615 /* find debug view */
616 for (i = 0; i < DEBUG_MAX_VIEWS; i++) { 616 for (i = 0; i < DEBUG_MAX_VIEWS; i++) {
617 if (!debug_info->views[i]) 617 if (!debug_info->views[i])
diff --git a/arch/s390/pci/pci_debug.c b/arch/s390/pci/pci_debug.c
index a303c95346cb..a5d07bc2a547 100644
--- a/arch/s390/pci/pci_debug.c
+++ b/arch/s390/pci/pci_debug.c
@@ -99,7 +99,7 @@ static ssize_t pci_perf_seq_write(struct file *file, const char __user *ubuf,
99static int pci_perf_seq_open(struct inode *inode, struct file *filp) 99static int pci_perf_seq_open(struct inode *inode, struct file *filp)
100{ 100{
101 return single_open(filp, pci_perf_show, 101 return single_open(filp, pci_perf_show,
102 filp->f_path.dentry->d_inode->i_private); 102 file_inode(filp)->i_private);
103} 103}
104 104
105static const struct file_operations debugfs_pci_perf_fops = { 105static const struct file_operations debugfs_pci_perf_fops = {
@@ -121,7 +121,7 @@ static int pci_debug_show(struct seq_file *m, void *v)
121static int pci_debug_seq_open(struct inode *inode, struct file *filp) 121static int pci_debug_seq_open(struct inode *inode, struct file *filp)
122{ 122{
123 return single_open(filp, pci_debug_show, 123 return single_open(filp, pci_debug_show,
124 filp->f_path.dentry->d_inode->i_private); 124 file_inode(filp)->i_private);
125} 125}
126 126
127static const struct file_operations debugfs_pci_debug_fops = { 127static const struct file_operations debugfs_pci_debug_fops = {
diff --git a/arch/sh/mm/alignment.c b/arch/sh/mm/alignment.c
index 620fa7ff9eec..aea14855e656 100644
--- a/arch/sh/mm/alignment.c
+++ b/arch/sh/mm/alignment.c
@@ -140,7 +140,7 @@ static int alignment_proc_open(struct inode *inode, struct file *file)
140static ssize_t alignment_proc_write(struct file *file, 140static ssize_t alignment_proc_write(struct file *file,
141 const char __user *buffer, size_t count, loff_t *pos) 141 const char __user *buffer, size_t count, loff_t *pos)
142{ 142{
143 int *data = PDE(file->f_path.dentry->d_inode)->data; 143 int *data = PDE(file_inode(file))->data;
144 char mode; 144 char mode;
145 145
146 if (count > 0) { 146 if (count > 0) {
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
index a703af19c281..03abf9b70011 100644
--- a/arch/x86/ia32/ia32_aout.c
+++ b/arch/x86/ia32/ia32_aout.c
@@ -271,7 +271,7 @@ static int load_aout_binary(struct linux_binprm *bprm)
271 if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && 271 if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC &&
272 N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) || 272 N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) ||
273 N_TRSIZE(ex) || N_DRSIZE(ex) || 273 N_TRSIZE(ex) || N_DRSIZE(ex) ||
274 i_size_read(bprm->file->f_path.dentry->d_inode) < 274 i_size_read(file_inode(bprm->file)) <
275 ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { 275 ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) {
276 return -ENOEXEC; 276 return -ENOEXEC;
277 } 277 }
@@ -425,12 +425,10 @@ beyond_if:
425 425
426static int load_aout_library(struct file *file) 426static int load_aout_library(struct file *file)
427{ 427{
428 struct inode *inode;
429 unsigned long bss, start_addr, len, error; 428 unsigned long bss, start_addr, len, error;
430 int retval; 429 int retval;
431 struct exec ex; 430 struct exec ex;
432 431
433 inode = file->f_path.dentry->d_inode;
434 432
435 retval = -ENOEXEC; 433 retval = -ENOEXEC;
436 error = kernel_read(file, 0, (char *) &ex, sizeof(ex)); 434 error = kernel_read(file, 0, (char *) &ex, sizeof(ex));
@@ -440,7 +438,7 @@ static int load_aout_library(struct file *file)
440 /* We come in here for the regular a.out style of shared libraries */ 438 /* We come in here for the regular a.out style of shared libraries */
441 if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != QMAGIC) || N_TRSIZE(ex) || 439 if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != QMAGIC) || N_TRSIZE(ex) ||
442 N_DRSIZE(ex) || ((ex.a_entry & 0xfff) && N_MAGIC(ex) == ZMAGIC) || 440 N_DRSIZE(ex) || ((ex.a_entry & 0xfff) && N_MAGIC(ex) == ZMAGIC) ||
443 i_size_read(inode) < 441 i_size_read(file_inode(file)) <
444 ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { 442 ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) {
445 goto out; 443 goto out;
446 } 444 }
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 60c78917190c..1e4dbcfe6d31 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -85,7 +85,7 @@ static ssize_t cpuid_read(struct file *file, char __user *buf,
85{ 85{
86 char __user *tmp = buf; 86 char __user *tmp = buf;
87 struct cpuid_regs cmd; 87 struct cpuid_regs cmd;
88 int cpu = iminor(file->f_path.dentry->d_inode); 88 int cpu = iminor(file_inode(file));
89 u64 pos = *ppos; 89 u64 pos = *ppos;
90 ssize_t bytes = 0; 90 ssize_t bytes = 0;
91 int err = 0; 91 int err = 0;
@@ -116,7 +116,7 @@ static int cpuid_open(struct inode *inode, struct file *file)
116 unsigned int cpu; 116 unsigned int cpu;
117 struct cpuinfo_x86 *c; 117 struct cpuinfo_x86 *c;
118 118
119 cpu = iminor(file->f_path.dentry->d_inode); 119 cpu = iminor(file_inode(file));
120 if (cpu >= nr_cpu_ids || !cpu_online(cpu)) 120 if (cpu >= nr_cpu_ids || !cpu_online(cpu))
121 return -ENXIO; /* No such CPU */ 121 return -ENXIO; /* No such CPU */
122 122
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 9a13e889837e..8f12dc78a848 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -6547,7 +6547,7 @@ static ssize_t dac960_user_command_proc_write(struct file *file,
6547 const char __user *Buffer, 6547 const char __user *Buffer,
6548 size_t Count, loff_t *pos) 6548 size_t Count, loff_t *pos)
6549{ 6549{
6550 DAC960_Controller_T *Controller = (DAC960_Controller_T *) PDE(file->f_path.dentry->d_inode)->data; 6550 DAC960_Controller_T *Controller = (DAC960_Controller_T *) PDE(file_inode(file))->data;
6551 unsigned char CommandBuffer[80]; 6551 unsigned char CommandBuffer[80];
6552 int Length; 6552 int Length;
6553 if (Count > sizeof(CommandBuffer)-1) return -EINVAL; 6553 if (Count > sizeof(CommandBuffer)-1) return -EINVAL;
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 043ddcca4abf..ade146bf65e5 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -625,7 +625,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
625 return -EBUSY; 625 return -EBUSY;
626 file = fget(arg); 626 file = fget(arg);
627 if (file) { 627 if (file) {
628 struct inode *inode = file->f_path.dentry->d_inode; 628 struct inode *inode = file_inode(file);
629 if (S_ISSOCK(inode->i_mode)) { 629 if (S_ISSOCK(inode->i_mode)) {
630 nbd->file = file; 630 nbd->file = file;
631 nbd->sock = SOCKET_I(inode); 631 nbd->sock = SOCKET_I(inode);
diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c
index 052797b32bd3..01a5ca7425d7 100644
--- a/drivers/char/dsp56k.c
+++ b/drivers/char/dsp56k.c
@@ -181,7 +181,7 @@ static int dsp56k_upload(u_char __user *bin, int len)
181static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count, 181static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count,
182 loff_t *ppos) 182 loff_t *ppos)
183{ 183{
184 struct inode *inode = file->f_path.dentry->d_inode; 184 struct inode *inode = file_inode(file);
185 int dev = iminor(inode) & 0x0f; 185 int dev = iminor(inode) & 0x0f;
186 186
187 switch(dev) 187 switch(dev)
@@ -244,7 +244,7 @@ static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count,
244static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t count, 244static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t count,
245 loff_t *ppos) 245 loff_t *ppos)
246{ 246{
247 struct inode *inode = file->f_path.dentry->d_inode; 247 struct inode *inode = file_inode(file);
248 int dev = iminor(inode) & 0x0f; 248 int dev = iminor(inode) & 0x0f;
249 249
250 switch(dev) 250 switch(dev)
@@ -306,7 +306,7 @@ static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t co
306static long dsp56k_ioctl(struct file *file, unsigned int cmd, 306static long dsp56k_ioctl(struct file *file, unsigned int cmd,
307 unsigned long arg) 307 unsigned long arg)
308{ 308{
309 int dev = iminor(file->f_path.dentry->d_inode) & 0x0f; 309 int dev = iminor(file_inode(file)) & 0x0f;
310 void __user *argp = (void __user *)arg; 310 void __user *argp = (void __user *)arg;
311 311
312 switch(dev) 312 switch(dev)
@@ -408,7 +408,7 @@ static long dsp56k_ioctl(struct file *file, unsigned int cmd,
408#if 0 408#if 0
409static unsigned int dsp56k_poll(struct file *file, poll_table *wait) 409static unsigned int dsp56k_poll(struct file *file, poll_table *wait)
410{ 410{
411 int dev = iminor(file->f_path.dentry->d_inode) & 0x0f; 411 int dev = iminor(file_inode(file)) & 0x0f;
412 412
413 switch(dev) 413 switch(dev)
414 { 414 {
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
index 85156dd0caee..65a8d96c0e93 100644
--- a/drivers/char/dtlk.c
+++ b/drivers/char/dtlk.c
@@ -125,7 +125,7 @@ static char dtlk_write_tts(char);
125static ssize_t dtlk_read(struct file *file, char __user *buf, 125static ssize_t dtlk_read(struct file *file, char __user *buf,
126 size_t count, loff_t * ppos) 126 size_t count, loff_t * ppos)
127{ 127{
128 unsigned int minor = iminor(file->f_path.dentry->d_inode); 128 unsigned int minor = iminor(file_inode(file));
129 char ch; 129 char ch;
130 int i = 0, retries; 130 int i = 0, retries;
131 131
@@ -177,7 +177,7 @@ static ssize_t dtlk_write(struct file *file, const char __user *buf,
177 } 177 }
178#endif 178#endif
179 179
180 if (iminor(file->f_path.dentry->d_inode) != DTLK_MINOR) 180 if (iminor(file_inode(file)) != DTLK_MINOR)
181 return -EINVAL; 181 return -EINVAL;
182 182
183 while (1) { 183 while (1) {
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index a741e418b456..dafd9ac6428f 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -294,7 +294,7 @@ static int lp_wait_ready(int minor, int nonblock)
294static ssize_t lp_write(struct file * file, const char __user * buf, 294static ssize_t lp_write(struct file * file, const char __user * buf,
295 size_t count, loff_t *ppos) 295 size_t count, loff_t *ppos)
296{ 296{
297 unsigned int minor = iminor(file->f_path.dentry->d_inode); 297 unsigned int minor = iminor(file_inode(file));
298 struct parport *port = lp_table[minor].dev->port; 298 struct parport *port = lp_table[minor].dev->port;
299 char *kbuf = lp_table[minor].lp_buffer; 299 char *kbuf = lp_table[minor].lp_buffer;
300 ssize_t retv = 0; 300 ssize_t retv = 0;
@@ -413,7 +413,7 @@ static ssize_t lp_read(struct file * file, char __user * buf,
413 size_t count, loff_t *ppos) 413 size_t count, loff_t *ppos)
414{ 414{
415 DEFINE_WAIT(wait); 415 DEFINE_WAIT(wait);
416 unsigned int minor=iminor(file->f_path.dentry->d_inode); 416 unsigned int minor=iminor(file_inode(file));
417 struct parport *port = lp_table[minor].dev->port; 417 struct parport *port = lp_table[minor].dev->port;
418 ssize_t retval = 0; 418 ssize_t retval = 0;
419 char *kbuf = lp_table[minor].lp_buffer; 419 char *kbuf = lp_table[minor].lp_buffer;
@@ -679,7 +679,7 @@ static long lp_ioctl(struct file *file, unsigned int cmd,
679 struct timeval par_timeout; 679 struct timeval par_timeout;
680 int ret; 680 int ret;
681 681
682 minor = iminor(file->f_path.dentry->d_inode); 682 minor = iminor(file_inode(file));
683 mutex_lock(&lp_mutex); 683 mutex_lock(&lp_mutex);
684 switch (cmd) { 684 switch (cmd) {
685 case LPSETTIMEOUT: 685 case LPSETTIMEOUT:
@@ -707,7 +707,7 @@ static long lp_compat_ioctl(struct file *file, unsigned int cmd,
707 struct timeval par_timeout; 707 struct timeval par_timeout;
708 int ret; 708 int ret;
709 709
710 minor = iminor(file->f_path.dentry->d_inode); 710 minor = iminor(file_inode(file));
711 mutex_lock(&lp_mutex); 711 mutex_lock(&lp_mutex);
712 switch (cmd) { 712 switch (cmd) {
713 case LPSETTIMEOUT: 713 case LPSETTIMEOUT:
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index c6fa3bc2baa8..e23b4a247b72 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -708,7 +708,7 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
708{ 708{
709 loff_t ret; 709 loff_t ret;
710 710
711 mutex_lock(&file->f_path.dentry->d_inode->i_mutex); 711 mutex_lock(&file_inode(file)->i_mutex);
712 switch (orig) { 712 switch (orig) {
713 case SEEK_CUR: 713 case SEEK_CUR:
714 offset += file->f_pos; 714 offset += file->f_pos;
@@ -725,7 +725,7 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
725 default: 725 default:
726 ret = -EINVAL; 726 ret = -EINVAL;
727 } 727 }
728 mutex_unlock(&file->f_path.dentry->d_inode->i_mutex); 728 mutex_unlock(&file_inode(file)->i_mutex);
729 return ret; 729 return ret;
730} 730}
731 731
diff --git a/drivers/char/nsc_gpio.c b/drivers/char/nsc_gpio.c
index 808d44e9a32a..b07b119ae57f 100644
--- a/drivers/char/nsc_gpio.c
+++ b/drivers/char/nsc_gpio.c
@@ -41,7 +41,7 @@ void nsc_gpio_dump(struct nsc_gpio_ops *amp, unsigned index)
41ssize_t nsc_gpio_write(struct file *file, const char __user *data, 41ssize_t nsc_gpio_write(struct file *file, const char __user *data,
42 size_t len, loff_t *ppos) 42 size_t len, loff_t *ppos)
43{ 43{
44 unsigned m = iminor(file->f_path.dentry->d_inode); 44 unsigned m = iminor(file_inode(file));
45 struct nsc_gpio_ops *amp = file->private_data; 45 struct nsc_gpio_ops *amp = file->private_data;
46 struct device *dev = amp->dev; 46 struct device *dev = amp->dev;
47 size_t i; 47 size_t i;
@@ -104,7 +104,7 @@ ssize_t nsc_gpio_write(struct file *file, const char __user *data,
104ssize_t nsc_gpio_read(struct file *file, char __user * buf, 104ssize_t nsc_gpio_read(struct file *file, char __user * buf,
105 size_t len, loff_t * ppos) 105 size_t len, loff_t * ppos)
106{ 106{
107 unsigned m = iminor(file->f_path.dentry->d_inode); 107 unsigned m = iminor(file_inode(file));
108 int value; 108 int value;
109 struct nsc_gpio_ops *amp = file->private_data; 109 struct nsc_gpio_ops *amp = file->private_data;
110 110
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index a7584860e9a7..c115217c79ae 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -1400,7 +1400,7 @@ static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
1400{ 1400{
1401 struct cm4000_dev *dev = filp->private_data; 1401 struct cm4000_dev *dev = filp->private_data;
1402 unsigned int iobase = dev->p_dev->resource[0]->start; 1402 unsigned int iobase = dev->p_dev->resource[0]->start;
1403 struct inode *inode = filp->f_path.dentry->d_inode; 1403 struct inode *inode = file_inode(filp);
1404 struct pcmcia_device *link; 1404 struct pcmcia_device *link;
1405 int size; 1405 int size;
1406 int rc; 1406 int rc;
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index 1cd49241e60e..ae0b42b66e55 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -107,7 +107,7 @@ static inline void pp_enable_irq (struct pp_struct *pp)
107static ssize_t pp_read (struct file * file, char __user * buf, size_t count, 107static ssize_t pp_read (struct file * file, char __user * buf, size_t count,
108 loff_t * ppos) 108 loff_t * ppos)
109{ 109{
110 unsigned int minor = iminor(file->f_path.dentry->d_inode); 110 unsigned int minor = iminor(file_inode(file));
111 struct pp_struct *pp = file->private_data; 111 struct pp_struct *pp = file->private_data;
112 char * kbuffer; 112 char * kbuffer;
113 ssize_t bytes_read = 0; 113 ssize_t bytes_read = 0;
@@ -189,7 +189,7 @@ static ssize_t pp_read (struct file * file, char __user * buf, size_t count,
189static ssize_t pp_write (struct file * file, const char __user * buf, 189static ssize_t pp_write (struct file * file, const char __user * buf,
190 size_t count, loff_t * ppos) 190 size_t count, loff_t * ppos)
191{ 191{
192 unsigned int minor = iminor(file->f_path.dentry->d_inode); 192 unsigned int minor = iminor(file_inode(file));
193 struct pp_struct *pp = file->private_data; 193 struct pp_struct *pp = file->private_data;
194 char * kbuffer; 194 char * kbuffer;
195 ssize_t bytes_written = 0; 195 ssize_t bytes_written = 0;
@@ -324,7 +324,7 @@ static enum ieee1284_phase init_phase (int mode)
324 324
325static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 325static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
326{ 326{
327 unsigned int minor = iminor(file->f_path.dentry->d_inode); 327 unsigned int minor = iminor(file_inode(file));
328 struct pp_struct *pp = file->private_data; 328 struct pp_struct *pp = file->private_data;
329 struct parport * port; 329 struct parport * port;
330 void __user *argp = (void __user *)arg; 330 void __user *argp = (void __user *)arg;
diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c
index 588063ac9517..8cafa9ccd43f 100644
--- a/drivers/char/ps3flash.c
+++ b/drivers/char/ps3flash.c
@@ -312,7 +312,7 @@ static int ps3flash_flush(struct file *file, fl_owner_t id)
312 312
313static int ps3flash_fsync(struct file *file, loff_t start, loff_t end, int datasync) 313static int ps3flash_fsync(struct file *file, loff_t start, loff_t end, int datasync)
314{ 314{
315 struct inode *inode = file->f_path.dentry->d_inode; 315 struct inode *inode = file_inode(file);
316 int err; 316 int err;
317 mutex_lock(&inode->i_mutex); 317 mutex_lock(&inode->i_mutex);
318 err = ps3flash_writeback(ps3flash_dev); 318 err = ps3flash_writeback(ps3flash_dev);
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index 54a3a6d09819..f3223aac4df1 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -80,7 +80,7 @@ static int raw_open(struct inode *inode, struct file *filp)
80 filp->f_flags |= O_DIRECT; 80 filp->f_flags |= O_DIRECT;
81 filp->f_mapping = bdev->bd_inode->i_mapping; 81 filp->f_mapping = bdev->bd_inode->i_mapping;
82 if (++raw_devices[minor].inuse == 1) 82 if (++raw_devices[minor].inuse == 1)
83 filp->f_path.dentry->d_inode->i_mapping = 83 file_inode(filp)->i_mapping =
84 bdev->bd_inode->i_mapping; 84 bdev->bd_inode->i_mapping;
85 filp->private_data = bdev; 85 filp->private_data = bdev;
86 mutex_unlock(&raw_mutex); 86 mutex_unlock(&raw_mutex);
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index d780295a1473..8450e178b819 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -938,7 +938,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,
938 } 938 }
939 939
940 if (ret > 0) { 940 if (ret > 0) {
941 struct inode *inode = file->f_path.dentry->d_inode; 941 struct inode *inode = file_inode(file);
942 inode->i_atime = current_fs_time(inode->i_sb); 942 inode->i_atime = current_fs_time(inode->i_sb);
943 } 943 }
944 944
diff --git a/drivers/char/tb0219.c b/drivers/char/tb0219.c
index 34c63f85104d..47b9fdfcf083 100644
--- a/drivers/char/tb0219.c
+++ b/drivers/char/tb0219.c
@@ -164,7 +164,7 @@ static ssize_t tanbac_tb0219_read(struct file *file, char __user *buf, size_t le
164 unsigned int minor; 164 unsigned int minor;
165 char value; 165 char value;
166 166
167 minor = iminor(file->f_path.dentry->d_inode); 167 minor = iminor(file_inode(file));
168 switch (minor) { 168 switch (minor) {
169 case 0: 169 case 0:
170 value = get_led(); 170 value = get_led();
@@ -200,7 +200,7 @@ static ssize_t tanbac_tb0219_write(struct file *file, const char __user *data,
200 int retval = 0; 200 int retval = 0;
201 char c; 201 char c;
202 202
203 minor = iminor(file->f_path.dentry->d_inode); 203 minor = iminor(file_inode(file));
204 switch (minor) { 204 switch (minor) {
205 case 0: 205 case 0:
206 type = TYPE_LED; 206 type = TYPE_LED;
diff --git a/drivers/gpu/drm/gma500/gtt.c b/drivers/gpu/drm/gma500/gtt.c
index 04a371aceb34..054e26e769ec 100644
--- a/drivers/gpu/drm/gma500/gtt.c
+++ b/drivers/gpu/drm/gma500/gtt.c
@@ -202,7 +202,7 @@ static int psb_gtt_attach_pages(struct gtt_range *gt)
202 WARN_ON(gt->pages); 202 WARN_ON(gt->pages);
203 203
204 /* This is the shared memory object that backs the GEM resource */ 204 /* This is the shared memory object that backs the GEM resource */
205 inode = gt->gem.filp->f_path.dentry->d_inode; 205 inode = file_inode(gt->gem.filp);
206 mapping = inode->i_mapping; 206 mapping = inode->i_mapping;
207 207
208 gt->pages = kmalloc(pages * sizeof(struct page *), GFP_KERNEL); 208 gt->pages = kmalloc(pages * sizeof(struct page *), GFP_KERNEL);
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 8febea6daa08..d7d772b30f1a 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1635,7 +1635,7 @@ i915_gem_object_truncate(struct drm_i915_gem_object *obj)
1635 * To do this we must instruct the shmfs to drop all of its 1635 * To do this we must instruct the shmfs to drop all of its
1636 * backing pages, *now*. 1636 * backing pages, *now*.
1637 */ 1637 */
1638 inode = obj->base.filp->f_path.dentry->d_inode; 1638 inode = file_inode(obj->base.filp);
1639 shmem_truncate_range(inode, 0, (loff_t)-1); 1639 shmem_truncate_range(inode, 0, (loff_t)-1);
1640 1640
1641 obj->madv = __I915_MADV_PURGED; 1641 obj->madv = __I915_MADV_PURGED;
@@ -1800,7 +1800,7 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj)
1800 * 1800 *
1801 * Fail silently without starting the shrinker 1801 * Fail silently without starting the shrinker
1802 */ 1802 */
1803 mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping; 1803 mapping = file_inode(obj->base.filp)->i_mapping;
1804 gfp = mapping_gfp_mask(mapping); 1804 gfp = mapping_gfp_mask(mapping);
1805 gfp |= __GFP_NORETRY | __GFP_NOWARN | __GFP_NO_KSWAPD; 1805 gfp |= __GFP_NORETRY | __GFP_NOWARN | __GFP_NO_KSWAPD;
1806 gfp &= ~(__GFP_IO | __GFP_WAIT); 1806 gfp &= ~(__GFP_IO | __GFP_WAIT);
@@ -3724,7 +3724,7 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
3724 mask |= __GFP_DMA32; 3724 mask |= __GFP_DMA32;
3725 } 3725 }
3726 3726
3727 mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping; 3727 mapping = file_inode(obj->base.filp)->i_mapping;
3728 mapping_set_gfp_mask(mapping, mask); 3728 mapping_set_gfp_mask(mapping, mask);
3729 3729
3730 i915_gem_object_init(obj, &i915_gem_object_ops); 3730 i915_gem_object_init(obj, &i915_gem_object_ops);
@@ -4228,7 +4228,7 @@ void i915_gem_free_all_phys_object(struct drm_device *dev)
4228void i915_gem_detach_phys_object(struct drm_device *dev, 4228void i915_gem_detach_phys_object(struct drm_device *dev,
4229 struct drm_i915_gem_object *obj) 4229 struct drm_i915_gem_object *obj)
4230{ 4230{
4231 struct address_space *mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping; 4231 struct address_space *mapping = file_inode(obj->base.filp)->i_mapping;
4232 char *vaddr; 4232 char *vaddr;
4233 int i; 4233 int i;
4234 int page_count; 4234 int page_count;
@@ -4264,7 +4264,7 @@ i915_gem_attach_phys_object(struct drm_device *dev,
4264 int id, 4264 int id,
4265 int align) 4265 int align)
4266{ 4266{
4267 struct address_space *mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping; 4267 struct address_space *mapping = file_inode(obj->base.filp)->i_mapping;
4268 drm_i915_private_t *dev_priv = dev->dev_private; 4268 drm_i915_private_t *dev_priv = dev->dev_private;
4269 int ret = 0; 4269 int ret = 0;
4270 int page_count; 4270 int page_count;
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 7d759a430294..5e93a52d4f2c 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -296,7 +296,7 @@ int ttm_tt_swapin(struct ttm_tt *ttm)
296 swap_storage = ttm->swap_storage; 296 swap_storage = ttm->swap_storage;
297 BUG_ON(swap_storage == NULL); 297 BUG_ON(swap_storage == NULL);
298 298
299 swap_space = swap_storage->f_path.dentry->d_inode->i_mapping; 299 swap_space = file_inode(swap_storage)->i_mapping;
300 300
301 for (i = 0; i < ttm->num_pages; ++i) { 301 for (i = 0; i < ttm->num_pages; ++i) {
302 from_page = shmem_read_mapping_page(swap_space, i); 302 from_page = shmem_read_mapping_page(swap_space, i);
@@ -345,7 +345,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage)
345 } else 345 } else
346 swap_storage = persistent_swap_storage; 346 swap_storage = persistent_swap_storage;
347 347
348 swap_space = swap_storage->f_path.dentry->d_inode->i_mapping; 348 swap_space = file_inode(swap_storage)->i_mapping;
349 349
350 for (i = 0; i < ttm->num_pages; ++i) { 350 for (i = 0; i < ttm->num_pages; ++i) {
351 from_page = ttm->pages[i]; 351 from_page = ttm->pages[i];
diff --git a/drivers/gpu/drm/udl/udl_gem.c b/drivers/gpu/drm/udl/udl_gem.c
index afd212c99216..3816270ba49b 100644
--- a/drivers/gpu/drm/udl/udl_gem.c
+++ b/drivers/gpu/drm/udl/udl_gem.c
@@ -137,7 +137,7 @@ static int udl_gem_get_pages(struct udl_gem_object *obj, gfp_t gfpmask)
137 if (obj->pages == NULL) 137 if (obj->pages == NULL)
138 return -ENOMEM; 138 return -ENOMEM;
139 139
140 inode = obj->base.filp->f_path.dentry->d_inode; 140 inode = file_inode(obj->base.filp);
141 mapping = inode->i_mapping; 141 mapping = inode->i_mapping;
142 gfpmask |= mapping_gfp_mask(mapping); 142 gfpmask |= mapping_gfp_mask(mapping);
143 143
diff --git a/drivers/hid/hid-roccat.c b/drivers/hid/hid-roccat.c
index b685b04dbf9d..d7437ef5c695 100644
--- a/drivers/hid/hid-roccat.c
+++ b/drivers/hid/hid-roccat.c
@@ -378,7 +378,7 @@ EXPORT_SYMBOL_GPL(roccat_disconnect);
378 378
379static long roccat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 379static long roccat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
380{ 380{
381 struct inode *inode = file->f_path.dentry->d_inode; 381 struct inode *inode = file_inode(file);
382 struct roccat_device *device; 382 struct roccat_device *device;
383 unsigned int minor = iminor(inode); 383 unsigned int minor = iminor(inode);
384 long retval = 0; 384 long retval = 0;
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 413a73187d33..3ad07a53a229 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -108,7 +108,7 @@ out:
108 * This function is to be called with the minors_lock mutex held */ 108 * This function is to be called with the minors_lock mutex held */
109static ssize_t hidraw_send_report(struct file *file, const char __user *buffer, size_t count, unsigned char report_type) 109static ssize_t hidraw_send_report(struct file *file, const char __user *buffer, size_t count, unsigned char report_type)
110{ 110{
111 unsigned int minor = iminor(file->f_path.dentry->d_inode); 111 unsigned int minor = iminor(file_inode(file));
112 struct hid_device *dev; 112 struct hid_device *dev;
113 __u8 *buf; 113 __u8 *buf;
114 int ret = 0; 114 int ret = 0;
@@ -176,7 +176,7 @@ static ssize_t hidraw_write(struct file *file, const char __user *buffer, size_t
176 * mutex held. */ 176 * mutex held. */
177static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t count, unsigned char report_type) 177static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t count, unsigned char report_type)
178{ 178{
179 unsigned int minor = iminor(file->f_path.dentry->d_inode); 179 unsigned int minor = iminor(file_inode(file));
180 struct hid_device *dev; 180 struct hid_device *dev;
181 __u8 *buf; 181 __u8 *buf;
182 int ret = 0, len; 182 int ret = 0, len;
@@ -340,7 +340,7 @@ unlock:
340static long hidraw_ioctl(struct file *file, unsigned int cmd, 340static long hidraw_ioctl(struct file *file, unsigned int cmd,
341 unsigned long arg) 341 unsigned long arg)
342{ 342{
343 struct inode *inode = file->f_path.dentry->d_inode; 343 struct inode *inode = file_inode(file);
344 unsigned int minor = iminor(inode); 344 unsigned int minor = iminor(inode);
345 long ret = 0; 345 long ret = 0;
346 struct hidraw *dev; 346 struct hidraw *dev;
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 5ec2261574ec..c3ccdea3d180 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -148,7 +148,7 @@ static ssize_t i2cdev_read(struct file *file, char __user *buf, size_t count,
148 return -ENOMEM; 148 return -ENOMEM;
149 149
150 pr_debug("i2c-dev: i2c-%d reading %zu bytes.\n", 150 pr_debug("i2c-dev: i2c-%d reading %zu bytes.\n",
151 iminor(file->f_path.dentry->d_inode), count); 151 iminor(file_inode(file)), count);
152 152
153 ret = i2c_master_recv(client, tmp, count); 153 ret = i2c_master_recv(client, tmp, count);
154 if (ret >= 0) 154 if (ret >= 0)
@@ -172,7 +172,7 @@ static ssize_t i2cdev_write(struct file *file, const char __user *buf,
172 return PTR_ERR(tmp); 172 return PTR_ERR(tmp);
173 173
174 pr_debug("i2c-dev: i2c-%d writing %zu bytes.\n", 174 pr_debug("i2c-dev: i2c-%d writing %zu bytes.\n",
175 iminor(file->f_path.dentry->d_inode), count); 175 iminor(file_inode(file)), count);
176 176
177 ret = i2c_master_send(client, tmp, count); 177 ret = i2c_master_send(client, tmp, count);
178 kfree(tmp); 178 kfree(tmp);
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
index a3133d7b2a0c..2abcc4790f12 100644
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -333,7 +333,7 @@ static int ide_settings_proc_open(struct inode *inode, struct file *file)
333static ssize_t ide_settings_proc_write(struct file *file, const char __user *buffer, 333static ssize_t ide_settings_proc_write(struct file *file, const char __user *buffer,
334 size_t count, loff_t *pos) 334 size_t count, loff_t *pos)
335{ 335{
336 ide_drive_t *drive = (ide_drive_t *) PDE(file->f_path.dentry->d_inode)->data; 336 ide_drive_t *drive = (ide_drive_t *) PDE(file_inode(file))->data;
337 char name[MAX_LEN + 1]; 337 char name[MAX_LEN + 1];
338 int for_real = 0, mul_factor, div_factor; 338 int for_real = 0, mul_factor, div_factor;
339 unsigned long n; 339 unsigned long n;
@@ -558,7 +558,7 @@ static int ide_replace_subdriver(ide_drive_t *drive, const char *driver)
558static ssize_t ide_driver_proc_write(struct file *file, const char __user *buffer, 558static ssize_t ide_driver_proc_write(struct file *file, const char __user *buffer,
559 size_t count, loff_t *pos) 559 size_t count, loff_t *pos)
560{ 560{
561 ide_drive_t *drive = (ide_drive_t *) PDE(file->f_path.dentry->d_inode)->data; 561 ide_drive_t *drive = (ide_drive_t *) PDE(file_inode(file))->data;
562 char name[32]; 562 char name[32];
563 563
564 if (!capable(CAP_SYS_ADMIN)) 564 if (!capable(CAP_SYS_ADMIN))
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 0cb0007724a2..792e7e9b376f 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -730,7 +730,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
730 goto err_tree_mutex_unlock; 730 goto err_tree_mutex_unlock;
731 } 731 }
732 732
733 inode = f.file->f_path.dentry->d_inode; 733 inode = file_inode(f.file);
734 xrcd = find_xrcd(file->device, inode); 734 xrcd = find_xrcd(file->device, inode);
735 if (!xrcd && !(cmd.oflags & O_CREAT)) { 735 if (!xrcd && !(cmd.oflags & O_CREAT)) {
736 /* no file descriptor. Need CREATE flag */ 736 /* no file descriptor. Need CREATE flag */
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c
index 3eb7e454849b..aed8afee56da 100644
--- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
+++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
@@ -1864,9 +1864,9 @@ static int ipath_assign_port(struct file *fp,
1864 goto done_chk_sdma; 1864 goto done_chk_sdma;
1865 } 1865 }
1866 1866
1867 i_minor = iminor(fp->f_path.dentry->d_inode) - IPATH_USER_MINOR_BASE; 1867 i_minor = iminor(file_inode(fp)) - IPATH_USER_MINOR_BASE;
1868 ipath_cdbg(VERBOSE, "open on dev %lx (minor %d)\n", 1868 ipath_cdbg(VERBOSE, "open on dev %lx (minor %d)\n",
1869 (long)fp->f_path.dentry->d_inode->i_rdev, i_minor); 1869 (long)file_inode(fp)->i_rdev, i_minor);
1870 1870
1871 if (i_minor) 1871 if (i_minor)
1872 ret = find_free_port(i_minor - 1, fp, uinfo); 1872 ret = find_free_port(i_minor - 1, fp, uinfo);
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c
index a4de9d58e9b4..a479375a8fd8 100644
--- a/drivers/infiniband/hw/ipath/ipath_fs.c
+++ b/drivers/infiniband/hw/ipath/ipath_fs.c
@@ -113,7 +113,7 @@ static ssize_t atomic_counters_read(struct file *file, char __user *buf,
113 struct infinipath_counters counters; 113 struct infinipath_counters counters;
114 struct ipath_devdata *dd; 114 struct ipath_devdata *dd;
115 115
116 dd = file->f_path.dentry->d_inode->i_private; 116 dd = file_inode(file)->i_private;
117 dd->ipath_f_read_counters(dd, &counters); 117 dd->ipath_f_read_counters(dd, &counters);
118 118
119 return simple_read_from_buffer(buf, count, ppos, &counters, 119 return simple_read_from_buffer(buf, count, ppos, &counters,
@@ -154,7 +154,7 @@ static ssize_t flash_read(struct file *file, char __user *buf,
154 goto bail; 154 goto bail;
155 } 155 }
156 156
157 dd = file->f_path.dentry->d_inode->i_private; 157 dd = file_inode(file)->i_private;
158 if (ipath_eeprom_read(dd, pos, tmp, count)) { 158 if (ipath_eeprom_read(dd, pos, tmp, count)) {
159 ipath_dev_err(dd, "failed to read from flash\n"); 159 ipath_dev_err(dd, "failed to read from flash\n");
160 ret = -ENXIO; 160 ret = -ENXIO;
@@ -207,7 +207,7 @@ static ssize_t flash_write(struct file *file, const char __user *buf,
207 goto bail_tmp; 207 goto bail_tmp;
208 } 208 }
209 209
210 dd = file->f_path.dentry->d_inode->i_private; 210 dd = file_inode(file)->i_private;
211 if (ipath_eeprom_write(dd, pos, tmp, count)) { 211 if (ipath_eeprom_write(dd, pos, tmp, count)) {
212 ret = -ENXIO; 212 ret = -ENXIO;
213 ipath_dev_err(dd, "failed to write to flash\n"); 213 ipath_dev_err(dd, "failed to write to flash\n");
diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c b/drivers/infiniband/hw/qib/qib_file_ops.c
index 959a5c4ff812..4f7aa301b3b1 100644
--- a/drivers/infiniband/hw/qib/qib_file_ops.c
+++ b/drivers/infiniband/hw/qib/qib_file_ops.c
@@ -1524,7 +1524,7 @@ static int qib_assign_ctxt(struct file *fp, const struct qib_user_info *uinfo)
1524 } 1524 }
1525 } 1525 }
1526 1526
1527 i_minor = iminor(fp->f_dentry->d_inode) - QIB_USER_MINOR_BASE; 1527 i_minor = iminor(file_inode(fp)) - QIB_USER_MINOR_BASE;
1528 if (i_minor) 1528 if (i_minor)
1529 ret = find_free_ctxt(i_minor - 1, fp, uinfo); 1529 ret = find_free_ctxt(i_minor - 1, fp, uinfo);
1530 else 1530 else
diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c
index 65a2a23f6f8a..644bd6f6467c 100644
--- a/drivers/infiniband/hw/qib/qib_fs.c
+++ b/drivers/infiniband/hw/qib/qib_fs.c
@@ -45,7 +45,7 @@
45 45
46static struct super_block *qib_super; 46static struct super_block *qib_super;
47 47
48#define private2dd(file) ((file)->f_dentry->d_inode->i_private) 48#define private2dd(file) (file_inode(file)->i_private)
49 49
50static int qibfs_mknod(struct inode *dir, struct dentry *dentry, 50static int qibfs_mknod(struct inode *dir, struct dentry *dentry,
51 umode_t mode, const struct file_operations *fops, 51 umode_t mode, const struct file_operations *fops,
@@ -171,7 +171,7 @@ static const struct file_operations cntr_ops[] = {
171}; 171};
172 172
173/* 173/*
174 * Could use file->f_dentry->d_inode->i_ino to figure out which file, 174 * Could use file_inode(file)->i_ino to figure out which file,
175 * instead of separate routine for each, but for now, this works... 175 * instead of separate routine for each, but for now, this works...
176 */ 176 */
177 177
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index fc178893789a..7db150ca163e 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -964,7 +964,6 @@ static ssize_t smmu_debugfs_stats_write(struct file *file,
964{ 964{
965 struct smmu_debugfs_info *info; 965 struct smmu_debugfs_info *info;
966 struct smmu_device *smmu; 966 struct smmu_device *smmu;
967 struct dentry *dent;
968 int i; 967 int i;
969 enum { 968 enum {
970 _OFF = 0, 969 _OFF = 0,
@@ -992,8 +991,7 @@ static ssize_t smmu_debugfs_stats_write(struct file *file,
992 if (i == ARRAY_SIZE(command)) 991 if (i == ARRAY_SIZE(command))
993 return -EINVAL; 992 return -EINVAL;
994 993
995 dent = file->f_dentry; 994 info = file_inode(file)->i_private;
996 info = dent->d_inode->i_private;
997 smmu = info->smmu; 995 smmu = info->smmu;
998 996
999 offs = SMMU_CACHE_CONFIG(info->cache); 997 offs = SMMU_CACHE_CONFIG(info->cache);
diff --git a/drivers/isdn/hardware/eicon/divasproc.c b/drivers/isdn/hardware/eicon/divasproc.c
index af4fd3d036c1..3a4165c61196 100644
--- a/drivers/isdn/hardware/eicon/divasproc.c
+++ b/drivers/isdn/hardware/eicon/divasproc.c
@@ -145,7 +145,7 @@ void remove_divas_proc(void)
145static ssize_t grp_opt_proc_write(struct file *file, const char __user *buffer, 145static ssize_t grp_opt_proc_write(struct file *file, const char __user *buffer,
146 size_t count, loff_t *pos) 146 size_t count, loff_t *pos)
147{ 147{
148 diva_os_xdi_adapter_t *a = PDE(file->f_path.dentry->d_inode)->data; 148 diva_os_xdi_adapter_t *a = PDE(file_inode(file))->data;
149 PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1]; 149 PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1];
150 150
151 if ((count == 1) || (count == 2)) { 151 if ((count == 1) || (count == 2)) {
@@ -172,7 +172,7 @@ static ssize_t grp_opt_proc_write(struct file *file, const char __user *buffer,
172static ssize_t d_l1_down_proc_write(struct file *file, const char __user *buffer, 172static ssize_t d_l1_down_proc_write(struct file *file, const char __user *buffer,
173 size_t count, loff_t *pos) 173 size_t count, loff_t *pos)
174{ 174{
175 diva_os_xdi_adapter_t *a = PDE(file->f_path.dentry->d_inode)->data; 175 diva_os_xdi_adapter_t *a = PDE(file_inode(file))->data;
176 PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1]; 176 PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1];
177 177
178 if ((count == 1) || (count == 2)) { 178 if ((count == 1) || (count == 2)) {
@@ -251,7 +251,7 @@ static const struct file_operations grp_opt_proc_fops = {
251static ssize_t info_proc_write(struct file *file, const char __user *buffer, 251static ssize_t info_proc_write(struct file *file, const char __user *buffer,
252 size_t count, loff_t *pos) 252 size_t count, loff_t *pos)
253{ 253{
254 diva_os_xdi_adapter_t *a = PDE(file->f_path.dentry->d_inode)->data; 254 diva_os_xdi_adapter_t *a = PDE(file_inode(file))->data;
255 PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1]; 255 PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1];
256 char c[4]; 256 char c[4];
257 257
diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c
index 88e4f0ee073c..9a3ce93665c5 100644
--- a/drivers/isdn/hysdn/hysdn_proclog.c
+++ b/drivers/isdn/hysdn/hysdn_proclog.c
@@ -173,7 +173,7 @@ hysdn_log_read(struct file *file, char __user *buf, size_t count, loff_t *off)
173{ 173{
174 struct log_data *inf; 174 struct log_data *inf;
175 int len; 175 int len;
176 struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 176 struct proc_dir_entry *pde = PDE(file_inode(file));
177 struct procdata *pd = NULL; 177 struct procdata *pd = NULL;
178 hysdn_card *card; 178 hysdn_card *card;
179 179
@@ -319,7 +319,7 @@ static unsigned int
319hysdn_log_poll(struct file *file, poll_table *wait) 319hysdn_log_poll(struct file *file, poll_table *wait)
320{ 320{
321 unsigned int mask = 0; 321 unsigned int mask = 0;
322 struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 322 struct proc_dir_entry *pde = PDE(file_inode(file));
323 hysdn_card *card; 323 hysdn_card *card;
324 struct procdata *pd = NULL; 324 struct procdata *pd = NULL;
325 325
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index e2a945ee9f05..32049ed2f24c 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -1058,7 +1058,7 @@ isdn_info_update(void)
1058static ssize_t 1058static ssize_t
1059isdn_read(struct file *file, char __user *buf, size_t count, loff_t *off) 1059isdn_read(struct file *file, char __user *buf, size_t count, loff_t *off)
1060{ 1060{
1061 uint minor = iminor(file->f_path.dentry->d_inode); 1061 uint minor = iminor(file_inode(file));
1062 int len = 0; 1062 int len = 0;
1063 int drvidx; 1063 int drvidx;
1064 int chidx; 1064 int chidx;
@@ -1165,7 +1165,7 @@ out:
1165static ssize_t 1165static ssize_t
1166isdn_write(struct file *file, const char __user *buf, size_t count, loff_t *off) 1166isdn_write(struct file *file, const char __user *buf, size_t count, loff_t *off)
1167{ 1167{
1168 uint minor = iminor(file->f_path.dentry->d_inode); 1168 uint minor = iminor(file_inode(file));
1169 int drvidx; 1169 int drvidx;
1170 int chidx; 1170 int chidx;
1171 int retval; 1171 int retval;
@@ -1228,7 +1228,7 @@ static unsigned int
1228isdn_poll(struct file *file, poll_table *wait) 1228isdn_poll(struct file *file, poll_table *wait)
1229{ 1229{
1230 unsigned int mask = 0; 1230 unsigned int mask = 0;
1231 unsigned int minor = iminor(file->f_path.dentry->d_inode); 1231 unsigned int minor = iminor(file_inode(file));
1232 int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL); 1232 int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
1233 1233
1234 mutex_lock(&isdn_mutex); 1234 mutex_lock(&isdn_mutex);
@@ -1269,7 +1269,7 @@ out:
1269static int 1269static int
1270isdn_ioctl(struct file *file, uint cmd, ulong arg) 1270isdn_ioctl(struct file *file, uint cmd, ulong arg)
1271{ 1271{
1272 uint minor = iminor(file->f_path.dentry->d_inode); 1272 uint minor = iminor(file_inode(file));
1273 isdn_ctrl c; 1273 isdn_ctrl c;
1274 int drvidx; 1274 int drvidx;
1275 int ret; 1275 int ret;
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index 61d78fa03b1a..38ceac5053a0 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -668,7 +668,7 @@ isdn_ppp_poll(struct file *file, poll_table *wait)
668 668
669 if (is->debug & 0x2) 669 if (is->debug & 0x2)
670 printk(KERN_DEBUG "isdn_ppp_poll: minor: %d\n", 670 printk(KERN_DEBUG "isdn_ppp_poll: minor: %d\n",
671 iminor(file->f_path.dentry->d_inode)); 671 iminor(file_inode(file)));
672 672
673 /* just registers wait_queue hook. This doesn't really wait. */ 673 /* just registers wait_queue hook. This doesn't really wait. */
674 poll_wait(file, &is->wq, wait); 674 poll_wait(file, &is->wq, wait);
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 7155945f8eb8..4fd9d6aeff6a 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -337,7 +337,7 @@ static int read_page(struct file *file, unsigned long index,
337 struct page *page) 337 struct page *page)
338{ 338{
339 int ret = 0; 339 int ret = 0;
340 struct inode *inode = file->f_path.dentry->d_inode; 340 struct inode *inode = file_inode(file);
341 struct buffer_head *bh; 341 struct buffer_head *bh;
342 sector_t block; 342 sector_t block;
343 343
@@ -755,7 +755,7 @@ static void bitmap_file_unmap(struct bitmap_storage *store)
755 free_buffers(sb_page); 755 free_buffers(sb_page);
756 756
757 if (file) { 757 if (file) {
758 struct inode *inode = file->f_path.dentry->d_inode; 758 struct inode *inode = file_inode(file);
759 invalidate_mapping_pages(inode->i_mapping, 0, -1); 759 invalidate_mapping_pages(inode->i_mapping, 0, -1);
760 fput(file); 760 fput(file);
761 } 761 }
diff --git a/drivers/media/pci/zoran/zoran_procfs.c b/drivers/media/pci/zoran/zoran_procfs.c
index f1423b777db1..e084b0a21b1b 100644
--- a/drivers/media/pci/zoran/zoran_procfs.c
+++ b/drivers/media/pci/zoran/zoran_procfs.c
@@ -137,7 +137,7 @@ static int zoran_open(struct inode *inode, struct file *file)
137static ssize_t zoran_write(struct file *file, const char __user *buffer, 137static ssize_t zoran_write(struct file *file, const char __user *buffer,
138 size_t count, loff_t *ppos) 138 size_t count, loff_t *ppos)
139{ 139{
140 struct zoran *zr = PDE(file->f_path.dentry->d_inode)->data; 140 struct zoran *zr = PDE(file_inode(file))->data;
141 char *string, *sp; 141 char *string, *sp;
142 char *line, *ldelim, *varname, *svar, *tdelim; 142 char *line, *ldelim, *varname, *svar, *tdelim;
143 143
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index ca12d3289bfe..35002367485c 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -531,7 +531,7 @@ EXPORT_SYMBOL(lirc_dev_fop_close);
531 531
532unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait) 532unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait)
533{ 533{
534 struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)]; 534 struct irctl *ir = irctls[iminor(file_inode(file))];
535 unsigned int ret; 535 unsigned int ret;
536 536
537 if (!ir) { 537 if (!ir) {
@@ -565,7 +565,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
565{ 565{
566 __u32 mode; 566 __u32 mode;
567 int result = 0; 567 int result = 0;
568 struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)]; 568 struct irctl *ir = irctls[iminor(file_inode(file))];
569 569
570 if (!ir) { 570 if (!ir) {
571 printk(KERN_ERR "lirc_dev: %s: no irctl found!\n", __func__); 571 printk(KERN_ERR "lirc_dev: %s: no irctl found!\n", __func__);
@@ -650,7 +650,7 @@ ssize_t lirc_dev_fop_read(struct file *file,
650 size_t length, 650 size_t length,
651 loff_t *ppos) 651 loff_t *ppos)
652{ 652{
653 struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)]; 653 struct irctl *ir = irctls[iminor(file_inode(file))];
654 unsigned char *buf; 654 unsigned char *buf;
655 int ret = 0, written = 0; 655 int ret = 0, written = 0;
656 DECLARE_WAITQUEUE(wait, current); 656 DECLARE_WAITQUEUE(wait, current);
@@ -754,10 +754,10 @@ void *lirc_get_pdata(struct file *file)
754{ 754{
755 void *data = NULL; 755 void *data = NULL;
756 756
757 if (file && file->f_dentry && file->f_dentry->d_inode && 757 if (file && file->f_dentry && file_inode(file) &&
758 file->f_dentry->d_inode->i_rdev) { 758 file_inode(file)->i_rdev) {
759 struct irctl *ir; 759 struct irctl *ir;
760 ir = irctls[iminor(file->f_dentry->d_inode)]; 760 ir = irctls[iminor(file_inode(file))];
761 data = ir->d.data; 761 data = ir->d.data;
762 } 762 }
763 763
@@ -769,7 +769,7 @@ EXPORT_SYMBOL(lirc_get_pdata);
769ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer, 769ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer,
770 size_t length, loff_t *ppos) 770 size_t length, loff_t *ppos)
771{ 771{
772 struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)]; 772 struct irctl *ir = irctls[iminor(file_inode(file))];
773 773
774 if (!ir) { 774 if (!ir) {
775 printk(KERN_ERR "%s: called with invalid irctl\n", __func__); 775 printk(KERN_ERR "%s: called with invalid irctl\n", __func__);
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index 98dcad9c8a3b..870de1d5667a 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -222,7 +222,7 @@ static struct class video_class = {
222 222
223struct video_device *video_devdata(struct file *file) 223struct video_device *video_devdata(struct file *file)
224{ 224{
225 return video_device[iminor(file->f_path.dentry->d_inode)]; 225 return video_device[iminor(file_inode(file))];
226} 226}
227EXPORT_SYMBOL(video_devdata); 227EXPORT_SYMBOL(video_devdata);
228 228
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index dfcc65b33e99..4f02848bb2bc 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -194,7 +194,7 @@ static int vol_cdev_fsync(struct file *file, loff_t start, loff_t end,
194{ 194{
195 struct ubi_volume_desc *desc = file->private_data; 195 struct ubi_volume_desc *desc = file->private_data;
196 struct ubi_device *ubi = desc->vol->ubi; 196 struct ubi_device *ubi = desc->vol->ubi;
197 struct inode *inode = file->f_path.dentry->d_inode; 197 struct inode *inode = file_inode(file);
198 int err; 198 int err;
199 mutex_lock(&inode->i_mutex); 199 mutex_lock(&inode->i_mutex);
200 err = ubi_sync(ubi->ubi_num); 200 err = ubi_sync(ubi->ubi_num);
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index f0718e1a8369..8fb1ccfe74dc 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -2336,7 +2336,7 @@ static ssize_t mem_read(struct file *file, char __user *buf, size_t count,
2336 loff_t *ppos) 2336 loff_t *ppos)
2337{ 2337{
2338 loff_t pos = *ppos; 2338 loff_t pos = *ppos;
2339 loff_t avail = file->f_path.dentry->d_inode->i_size; 2339 loff_t avail = file_inode(file)->i_size;
2340 unsigned int mem = (uintptr_t)file->private_data & 3; 2340 unsigned int mem = (uintptr_t)file->private_data & 3;
2341 struct adapter *adap = file->private_data - mem; 2341 struct adapter *adap = file->private_data - mem;
2342 2342
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index 6aed238e573e..1505509728aa 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -939,14 +939,14 @@ static int cosa_open(struct inode *inode, struct file *file)
939 int ret = 0; 939 int ret = 0;
940 940
941 mutex_lock(&cosa_chardev_mutex); 941 mutex_lock(&cosa_chardev_mutex);
942 if ((n=iminor(file->f_path.dentry->d_inode)>>CARD_MINOR_BITS) 942 if ((n=iminor(file_inode(file))>>CARD_MINOR_BITS)
943 >= nr_cards) { 943 >= nr_cards) {
944 ret = -ENODEV; 944 ret = -ENODEV;
945 goto out; 945 goto out;
946 } 946 }
947 cosa = cosa_cards+n; 947 cosa = cosa_cards+n;
948 948
949 if ((n=iminor(file->f_path.dentry->d_inode) 949 if ((n=iminor(file_inode(file))
950 & ((1<<CARD_MINOR_BITS)-1)) >= cosa->nchannels) { 950 & ((1<<CARD_MINOR_BITS)-1)) >= cosa->nchannels) {
951 ret = -ENODEV; 951 ret = -ENODEV;
952 goto out; 952 goto out;
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 598ca1cafb95..5311ba1dcd2c 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -2769,7 +2769,7 @@ static ssize_t int_proc_write(struct file *file, const char __user *buffer,
2769 nr = nr * 10 + c; 2769 nr = nr * 10 + c;
2770 p++; 2770 p++;
2771 } while (--len); 2771 } while (--len);
2772 *(int *)PDE(file->f_path.dentry->d_inode)->data = nr; 2772 *(int *)PDE(file_inode(file))->data = nr;
2773 return count; 2773 return count;
2774} 2774}
2775 2775
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c
index f2f501e5b6a0..d4d800c54d86 100644
--- a/drivers/parisc/led.c
+++ b/drivers/parisc/led.c
@@ -179,7 +179,7 @@ static int led_proc_open(struct inode *inode, struct file *file)
179static ssize_t led_proc_write(struct file *file, const char *buf, 179static ssize_t led_proc_write(struct file *file, const char *buf,
180 size_t count, loff_t *pos) 180 size_t count, loff_t *pos)
181{ 181{
182 void *data = PDE(file->f_path.dentry->d_inode)->data; 182 void *data = PDE(file_inode(file))->data;
183 char *cur, lbuf[32]; 183 char *cur, lbuf[32];
184 int d; 184 int d;
185 185
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index 9b8505ccc56d..0b009470e6db 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -21,7 +21,7 @@ static loff_t
21proc_bus_pci_lseek(struct file *file, loff_t off, int whence) 21proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
22{ 22{
23 loff_t new = -1; 23 loff_t new = -1;
24 struct inode *inode = file->f_path.dentry->d_inode; 24 struct inode *inode = file_inode(file);
25 25
26 mutex_lock(&inode->i_mutex); 26 mutex_lock(&inode->i_mutex);
27 switch (whence) { 27 switch (whence) {
@@ -46,7 +46,7 @@ proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
46static ssize_t 46static ssize_t
47proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) 47proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
48{ 48{
49 const struct inode *ino = file->f_path.dentry->d_inode; 49 const struct inode *ino = file_inode(file);
50 const struct proc_dir_entry *dp = PDE(ino); 50 const struct proc_dir_entry *dp = PDE(ino);
51 struct pci_dev *dev = dp->data; 51 struct pci_dev *dev = dp->data;
52 unsigned int pos = *ppos; 52 unsigned int pos = *ppos;
@@ -132,7 +132,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
132static ssize_t 132static ssize_t
133proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, loff_t *ppos) 133proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, loff_t *ppos)
134{ 134{
135 struct inode *ino = file->f_path.dentry->d_inode; 135 struct inode *ino = file_inode(file);
136 const struct proc_dir_entry *dp = PDE(ino); 136 const struct proc_dir_entry *dp = PDE(ino);
137 struct pci_dev *dev = dp->data; 137 struct pci_dev *dev = dp->data;
138 int pos = *ppos; 138 int pos = *ppos;
@@ -212,7 +212,7 @@ struct pci_filp_private {
212static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, 212static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd,
213 unsigned long arg) 213 unsigned long arg)
214{ 214{
215 const struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); 215 const struct proc_dir_entry *dp = PDE(file_inode(file));
216 struct pci_dev *dev = dp->data; 216 struct pci_dev *dev = dp->data;
217#ifdef HAVE_PCI_MMAP 217#ifdef HAVE_PCI_MMAP
218 struct pci_filp_private *fpriv = file->private_data; 218 struct pci_filp_private *fpriv = file->private_data;
@@ -253,7 +253,7 @@ static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd,
253#ifdef HAVE_PCI_MMAP 253#ifdef HAVE_PCI_MMAP
254static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) 254static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma)
255{ 255{
256 struct inode *inode = file->f_path.dentry->d_inode; 256 struct inode *inode = file_inode(file);
257 const struct proc_dir_entry *dp = PDE(inode); 257 const struct proc_dir_entry *dp = PDE(inode);
258 struct pci_dev *dev = dp->data; 258 struct pci_dev *dev = dp->data;
259 struct pci_filp_private *fpriv = file->private_data; 259 struct pci_filp_private *fpriv = file->private_data;
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index b8ad71f7863f..8853d013a716 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -3566,7 +3566,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,
3566 } 3566 }
3567 3567
3568 if (ret > 0) { 3568 if (ret > 0) {
3569 struct inode *inode = file->f_path.dentry->d_inode; 3569 struct inode *inode = file_inode(file);
3570 inode->i_atime = current_fs_time(inode->i_sb); 3570 inode->i_atime = current_fs_time(inode->i_sb);
3571 } 3571 }
3572 3572
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index f946ca7cb762..05dfd569d912 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -852,7 +852,7 @@ static ssize_t dispatch_proc_write(struct file *file,
852 const char __user *userbuf, 852 const char __user *userbuf,
853 size_t count, loff_t *pos) 853 size_t count, loff_t *pos)
854{ 854{
855 struct ibm_struct *ibm = PDE(file->f_path.dentry->d_inode)->data; 855 struct ibm_struct *ibm = PDE(file_inode(file))->data;
856 char *kernbuf; 856 char *kernbuf;
857 int ret; 857 int ret;
858 858
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index c2727895794c..6fba80ad3bca 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -583,7 +583,7 @@ static int set_lcd_status(struct backlight_device *bd)
583static ssize_t lcd_proc_write(struct file *file, const char __user *buf, 583static ssize_t lcd_proc_write(struct file *file, const char __user *buf,
584 size_t count, loff_t *pos) 584 size_t count, loff_t *pos)
585{ 585{
586 struct toshiba_acpi_dev *dev = PDE(file->f_path.dentry->d_inode)->data; 586 struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data;
587 char cmd[42]; 587 char cmd[42];
588 size_t len; 588 size_t len;
589 int value; 589 int value;
@@ -650,7 +650,7 @@ static int video_proc_open(struct inode *inode, struct file *file)
650static ssize_t video_proc_write(struct file *file, const char __user *buf, 650static ssize_t video_proc_write(struct file *file, const char __user *buf,
651 size_t count, loff_t *pos) 651 size_t count, loff_t *pos)
652{ 652{
653 struct toshiba_acpi_dev *dev = PDE(file->f_path.dentry->d_inode)->data; 653 struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data;
654 char *cmd, *buffer; 654 char *cmd, *buffer;
655 int ret; 655 int ret;
656 int value; 656 int value;
@@ -750,7 +750,7 @@ static int fan_proc_open(struct inode *inode, struct file *file)
750static ssize_t fan_proc_write(struct file *file, const char __user *buf, 750static ssize_t fan_proc_write(struct file *file, const char __user *buf,
751 size_t count, loff_t *pos) 751 size_t count, loff_t *pos)
752{ 752{
753 struct toshiba_acpi_dev *dev = PDE(file->f_path.dentry->d_inode)->data; 753 struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data;
754 char cmd[42]; 754 char cmd[42];
755 size_t len; 755 size_t len;
756 int value; 756 int value;
@@ -822,7 +822,7 @@ static int keys_proc_open(struct inode *inode, struct file *file)
822static ssize_t keys_proc_write(struct file *file, const char __user *buf, 822static ssize_t keys_proc_write(struct file *file, const char __user *buf,
823 size_t count, loff_t *pos) 823 size_t count, loff_t *pos)
824{ 824{
825 struct toshiba_acpi_dev *dev = PDE(file->f_path.dentry->d_inode)->data; 825 struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data;
826 char cmd[42]; 826 char cmd[42];
827 size_t len; 827 size_t len;
828 int value; 828 int value;
diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c
index 315b3112aca8..65f735ac6b3b 100644
--- a/drivers/pnp/isapnp/proc.c
+++ b/drivers/pnp/isapnp/proc.c
@@ -30,7 +30,7 @@ static struct proc_dir_entry *isapnp_proc_bus_dir = NULL;
30static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) 30static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
31{ 31{
32 loff_t new = -1; 32 loff_t new = -1;
33 struct inode *inode = file->f_path.dentry->d_inode; 33 struct inode *inode = file_inode(file);
34 34
35 mutex_lock(&inode->i_mutex); 35 mutex_lock(&inode->i_mutex);
36 switch (whence) { 36 switch (whence) {
@@ -55,7 +55,7 @@ static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
55static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf, 55static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf,
56 size_t nbytes, loff_t * ppos) 56 size_t nbytes, loff_t * ppos)
57{ 57{
58 struct inode *ino = file->f_path.dentry->d_inode; 58 struct inode *ino = file_inode(file);
59 struct proc_dir_entry *dp = PDE(ino); 59 struct proc_dir_entry *dp = PDE(ino);
60 struct pnp_dev *dev = dp->data; 60 struct pnp_dev *dev = dp->data;
61 int pos = *ppos; 61 int pos = *ppos;
diff --git a/drivers/pnp/pnpbios/proc.c b/drivers/pnp/pnpbios/proc.c
index bc89f392a629..63ddb0173456 100644
--- a/drivers/pnp/pnpbios/proc.c
+++ b/drivers/pnp/pnpbios/proc.c
@@ -244,7 +244,7 @@ static int pnpbios_proc_open(struct inode *inode, struct file *file)
244static ssize_t pnpbios_proc_write(struct file *file, const char __user *buf, 244static ssize_t pnpbios_proc_write(struct file *file, const char __user *buf,
245 size_t count, loff_t *pos) 245 size_t count, loff_t *pos)
246{ 246{
247 void *data = PDE(file->f_path.dentry->d_inode)->data; 247 void *data = PDE(file_inode(file))->data;
248 struct pnp_bios_node *node; 248 struct pnp_bios_node *node;
249 int boot = (long)data >> 8; 249 int boot = (long)data >> 8;
250 u8 nodenum = (long)data; 250 u8 nodenum = (long)data;
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c
index 911704571b9c..5acdc5f7dae8 100644
--- a/drivers/s390/char/fs3270.c
+++ b/drivers/s390/char/fs3270.c
@@ -433,9 +433,9 @@ fs3270_open(struct inode *inode, struct file *filp)
433 struct idal_buffer *ib; 433 struct idal_buffer *ib;
434 int minor, rc = 0; 434 int minor, rc = 0;
435 435
436 if (imajor(filp->f_path.dentry->d_inode) != IBM_FS3270_MAJOR) 436 if (imajor(file_inode(filp)) != IBM_FS3270_MAJOR)
437 return -ENODEV; 437 return -ENODEV;
438 minor = iminor(filp->f_path.dentry->d_inode); 438 minor = iminor(file_inode(filp));
439 /* Check for minor 0 multiplexer. */ 439 /* Check for minor 0 multiplexer. */
440 if (minor == 0) { 440 if (minor == 0) {
441 struct tty_struct *tty = get_current_tty(); 441 struct tty_struct *tty = get_current_tty();
diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c
index 2d61db3fc62a..6dc60725de92 100644
--- a/drivers/s390/char/tape_char.c
+++ b/drivers/s390/char/tape_char.c
@@ -273,13 +273,13 @@ tapechar_open (struct inode *inode, struct file *filp)
273 int minor, rc; 273 int minor, rc;
274 274
275 DBF_EVENT(6, "TCHAR:open: %i:%i\n", 275 DBF_EVENT(6, "TCHAR:open: %i:%i\n",
276 imajor(filp->f_path.dentry->d_inode), 276 imajor(file_inode(filp)),
277 iminor(filp->f_path.dentry->d_inode)); 277 iminor(file_inode(filp)));
278 278
279 if (imajor(filp->f_path.dentry->d_inode) != tapechar_major) 279 if (imajor(file_inode(filp)) != tapechar_major)
280 return -ENODEV; 280 return -ENODEV;
281 281
282 minor = iminor(filp->f_path.dentry->d_inode); 282 minor = iminor(file_inode(filp));
283 device = tape_find_device(minor / TAPE_MINORS_PER_DEV); 283 device = tape_find_device(minor / TAPE_MINORS_PER_DEV);
284 if (IS_ERR(device)) { 284 if (IS_ERR(device)) {
285 DBF_EVENT(3, "TCHAR:open: tape_find_device() failed\n"); 285 DBF_EVENT(3, "TCHAR:open: tape_find_device() failed\n");
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
index 483f72ba030d..c180e3135b3b 100644
--- a/drivers/s390/char/vmur.c
+++ b/drivers/s390/char/vmur.c
@@ -703,7 +703,7 @@ static int ur_open(struct inode *inode, struct file *file)
703 * We treat the minor number as the devno of the ur device 703 * We treat the minor number as the devno of the ur device
704 * to find in the driver tree. 704 * to find in the driver tree.
705 */ 705 */
706 devno = MINOR(file->f_dentry->d_inode->i_rdev); 706 devno = MINOR(file_inode(file)->i_rdev);
707 707
708 urd = urdev_get_from_devno(devno); 708 urd = urdev_get_from_devno(devno);
709 if (!urd) { 709 if (!urd) {
diff --git a/drivers/s390/cio/qdio_debug.c b/drivers/s390/cio/qdio_debug.c
index e6e0d31c02ac..749b72739c4a 100644
--- a/drivers/s390/cio/qdio_debug.c
+++ b/drivers/s390/cio/qdio_debug.c
@@ -128,7 +128,7 @@ static int qstat_show(struct seq_file *m, void *v)
128static int qstat_seq_open(struct inode *inode, struct file *filp) 128static int qstat_seq_open(struct inode *inode, struct file *filp)
129{ 129{
130 return single_open(filp, qstat_show, 130 return single_open(filp, qstat_show,
131 filp->f_path.dentry->d_inode->i_private); 131 file_inode(filp)->i_private);
132} 132}
133 133
134static const struct file_operations debugfs_fops = { 134static const struct file_operations debugfs_fops = {
@@ -221,7 +221,7 @@ static ssize_t qperf_seq_write(struct file *file, const char __user *ubuf,
221static int qperf_seq_open(struct inode *inode, struct file *filp) 221static int qperf_seq_open(struct inode *inode, struct file *filp)
222{ 222{
223 return single_open(filp, qperf_show, 223 return single_open(filp, qperf_show,
224 filp->f_path.dentry->d_inode->i_private); 224 file_inode(filp)->i_private);
225} 225}
226 226
227static struct file_operations debugfs_perf_fops = { 227static struct file_operations debugfs_perf_fops = {
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c
index e85c803b30cd..fc1339cf91ac 100644
--- a/drivers/sbus/char/display7seg.c
+++ b/drivers/sbus/char/display7seg.c
@@ -107,7 +107,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
107 int error = 0; 107 int error = 0;
108 u8 ireg = 0; 108 u8 ireg = 0;
109 109
110 if (D7S_MINOR != iminor(file->f_path.dentry->d_inode)) 110 if (D7S_MINOR != iminor(file_inode(file)))
111 return -ENODEV; 111 return -ENODEV;
112 112
113 mutex_lock(&d7s_mutex); 113 mutex_lock(&d7s_mutex);
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index d1f0120cdb98..5e1e12c0cf42 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -640,7 +640,7 @@ out:
640/* This function handles ioctl for the character device */ 640/* This function handles ioctl for the character device */
641static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 641static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
642{ 642{
643 struct inode *inode = file->f_path.dentry->d_inode; 643 struct inode *inode = file_inode(file);
644 long timeout; 644 long timeout;
645 unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0; 645 unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0;
646 dma_addr_t dma_handle; 646 dma_addr_t dma_handle;
diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c
index 52a2f0580d97..c845bdbeb6c0 100644
--- a/drivers/scsi/3w-sas.c
+++ b/drivers/scsi/3w-sas.c
@@ -757,7 +757,7 @@ static long twl_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long
757 dma_addr_t dma_handle; 757 dma_addr_t dma_handle;
758 int request_id = 0; 758 int request_id = 0;
759 TW_Ioctl_Driver_Command driver_command; 759 TW_Ioctl_Driver_Command driver_command;
760 struct inode *inode = file->f_dentry->d_inode; 760 struct inode *inode = file_inode(file);
761 TW_Ioctl_Buf_Apache *tw_ioctl; 761 TW_Ioctl_Buf_Apache *tw_ioctl;
762 TW_Command_Full *full_command_packet; 762 TW_Command_Full *full_command_packet;
763 TW_Device_Extension *tw_dev = twl_device_extension_list[iminor(inode)]; 763 TW_Device_Extension *tw_dev = twl_device_extension_list[iminor(inode)];
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index 62071d2fc1ce..56662ae03dea 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -889,7 +889,7 @@ static long tw_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long a
889 unsigned long flags; 889 unsigned long flags;
890 unsigned int data_buffer_length = 0; 890 unsigned int data_buffer_length = 0;
891 unsigned long data_buffer_length_adjusted = 0; 891 unsigned long data_buffer_length_adjusted = 0;
892 struct inode *inode = file->f_dentry->d_inode; 892 struct inode *inode = file_inode(file);
893 unsigned long *cpu_addr; 893 unsigned long *cpu_addr;
894 long timeout; 894 long timeout;
895 TW_New_Ioctl *tw_ioctl; 895 TW_New_Ioctl *tw_ioctl;
diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c
index b42cbbd3d92d..c323b2030afa 100644
--- a/drivers/scsi/csiostor/csio_init.c
+++ b/drivers/scsi/csiostor/csio_init.c
@@ -71,7 +71,7 @@ static ssize_t
71csio_mem_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) 71csio_mem_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
72{ 72{
73 loff_t pos = *ppos; 73 loff_t pos = *ppos;
74 loff_t avail = file->f_path.dentry->d_inode->i_size; 74 loff_t avail = file_inode(file)->i_size;
75 unsigned int mem = (uintptr_t)file->private_data & 3; 75 unsigned int mem = (uintptr_t)file->private_data & 3;
76 struct csio_hw *hw = file->private_data - mem; 76 struct csio_hw *hw = file->private_data - mem;
77 77
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index b4f6c9a84e71..b6e2700ec1c6 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -2161,7 +2161,7 @@ static long adpt_unlocked_ioctl(struct file *file, uint cmd, ulong arg)
2161 struct inode *inode; 2161 struct inode *inode;
2162 long ret; 2162 long ret;
2163 2163
2164 inode = file->f_dentry->d_inode; 2164 inode = file_inode(file);
2165 2165
2166 mutex_lock(&adpt_mutex); 2166 mutex_lock(&adpt_mutex);
2167 ret = adpt_ioctl(inode, file, cmd, arg); 2167 ret = adpt_ioctl(inode, file, cmd, arg);
@@ -2177,7 +2177,7 @@ static long compat_adpt_ioctl(struct file *file,
2177 struct inode *inode; 2177 struct inode *inode;
2178 long ret; 2178 long ret;
2179 2179
2180 inode = file->f_dentry->d_inode; 2180 inode = file_inode(file);
2181 2181
2182 mutex_lock(&adpt_mutex); 2182 mutex_lock(&adpt_mutex);
2183 2183
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 98156a97c472..3e2b3717cb5c 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -977,7 +977,7 @@ static int check_tape(struct scsi_tape *STp, struct file *filp)
977 struct st_modedef *STm; 977 struct st_modedef *STm;
978 struct st_partstat *STps; 978 struct st_partstat *STps;
979 char *name = tape_name(STp); 979 char *name = tape_name(STp);
980 struct inode *inode = filp->f_path.dentry->d_inode; 980 struct inode *inode = file_inode(filp);
981 int mode = TAPE_MODE(inode); 981 int mode = TAPE_MODE(inode);
982 982
983 STp->ready = ST_READY; 983 STp->ready = ST_READY;
diff --git a/drivers/staging/bcm/Misc.c b/drivers/staging/bcm/Misc.c
index c92078e7fe86..5d5d95de081e 100644
--- a/drivers/staging/bcm/Misc.c
+++ b/drivers/staging/bcm/Misc.c
@@ -185,7 +185,7 @@ static int BcmFileDownload(struct bcm_mini_adapter *Adapter, const char *path, u
185 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Unable to Open %s\n", path); 185 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Unable to Open %s\n", path);
186 return -ENOENT; 186 return -ENOENT;
187 } 187 }
188 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Opened file is = %s and length =0x%lx to be downloaded at =0x%x", path, (unsigned long)flp->f_dentry->d_inode->i_size, loc); 188 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Opened file is = %s and length =0x%lx to be downloaded at =0x%x", path, (unsigned long)file_inode(flp)->i_size, loc);
189 do_gettimeofday(&tv); 189 do_gettimeofday(&tv);
190 190
191 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "download start %lx", ((tv.tv_sec * 1000) + (tv.tv_usec / 1000))); 191 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "download start %lx", ((tv.tv_sec * 1000) + (tv.tv_usec / 1000)));
diff --git a/drivers/staging/ccg/f_mass_storage.c b/drivers/staging/ccg/f_mass_storage.c
index 4f1142efa6d1..20bc2b454ac2 100644
--- a/drivers/staging/ccg/f_mass_storage.c
+++ b/drivers/staging/ccg/f_mass_storage.c
@@ -998,7 +998,7 @@ static int do_synchronize_cache(struct fsg_common *common)
998static void invalidate_sub(struct fsg_lun *curlun) 998static void invalidate_sub(struct fsg_lun *curlun)
999{ 999{
1000 struct file *filp = curlun->filp; 1000 struct file *filp = curlun->filp;
1001 struct inode *inode = filp->f_path.dentry->d_inode; 1001 struct inode *inode = file_inode(filp);
1002 unsigned long rc; 1002 unsigned long rc;
1003 1003
1004 rc = invalidate_mapping_pages(inode->i_mapping, 0, -1); 1004 rc = invalidate_mapping_pages(inode->i_mapping, 0, -1);
diff --git a/drivers/staging/ccg/rndis.c b/drivers/staging/ccg/rndis.c
index e4192b887de9..d9297eebbf73 100644
--- a/drivers/staging/ccg/rndis.c
+++ b/drivers/staging/ccg/rndis.c
@@ -1065,7 +1065,7 @@ static int rndis_proc_show(struct seq_file *m, void *v)
1065static ssize_t rndis_proc_write(struct file *file, const char __user *buffer, 1065static ssize_t rndis_proc_write(struct file *file, const char __user *buffer,
1066 size_t count, loff_t *ppos) 1066 size_t count, loff_t *ppos)
1067{ 1067{
1068 rndis_params *p = PDE(file->f_path.dentry->d_inode)->data; 1068 rndis_params *p = PDE(file_inode(file))->data;
1069 u32 speed = 0; 1069 u32 speed = 0;
1070 int i, fl_speed = 0; 1070 int i, fl_speed = 0;
1071 1071
diff --git a/drivers/staging/ccg/storage_common.c b/drivers/staging/ccg/storage_common.c
index 8d9bcd8207c8..abb01ac74cec 100644
--- a/drivers/staging/ccg/storage_common.c
+++ b/drivers/staging/ccg/storage_common.c
@@ -656,7 +656,7 @@ static int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
656 if (!(filp->f_mode & FMODE_WRITE)) 656 if (!(filp->f_mode & FMODE_WRITE))
657 ro = 1; 657 ro = 1;
658 658
659 inode = filp->f_path.dentry->d_inode; 659 inode = file_inode(filp);
660 if ((!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) { 660 if ((!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) {
661 LINFO(curlun, "invalid file type: %s\n", filename); 661 LINFO(curlun, "invalid file type: %s\n", filename);
662 goto out; 662 goto out;
diff --git a/drivers/staging/dgrp/dgrp_specproc.c b/drivers/staging/dgrp/dgrp_specproc.c
index c214078a89e9..b2bda32254ac 100644
--- a/drivers/staging/dgrp/dgrp_specproc.c
+++ b/drivers/staging/dgrp/dgrp_specproc.c
@@ -354,7 +354,7 @@ static int dgrp_gen_proc_open(struct inode *inode, struct file *file)
354 struct dgrp_proc_entry *entry; 354 struct dgrp_proc_entry *entry;
355 int ret = 0; 355 int ret = 0;
356 356
357 de = (struct proc_dir_entry *) PDE(file->f_dentry->d_inode); 357 de = (struct proc_dir_entry *) PDE(file_inode(file));
358 if (!de || !de->data) { 358 if (!de || !de->data) {
359 ret = -ENXIO; 359 ret = -ENXIO;
360 goto done; 360 goto done;
@@ -384,7 +384,7 @@ static int dgrp_gen_proc_close(struct inode *inode, struct file *file)
384 struct proc_dir_entry *de; 384 struct proc_dir_entry *de;
385 struct dgrp_proc_entry *entry; 385 struct dgrp_proc_entry *entry;
386 386
387 de = (struct proc_dir_entry *) PDE(file->f_dentry->d_inode); 387 de = (struct proc_dir_entry *) PDE(file_inode(file));
388 if (!de || !de->data) 388 if (!de || !de->data)
389 goto done; 389 goto done;
390 390
diff --git a/drivers/staging/omapdrm/omap_gem_helpers.c b/drivers/staging/omapdrm/omap_gem_helpers.c
index ffb8cceaeb46..7d1b64a7404b 100644
--- a/drivers/staging/omapdrm/omap_gem_helpers.c
+++ b/drivers/staging/omapdrm/omap_gem_helpers.c
@@ -40,7 +40,7 @@ struct page **_drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask)
40 int i, npages; 40 int i, npages;
41 41
42 /* This is the shared memory object that backs the GEM resource */ 42 /* This is the shared memory object that backs the GEM resource */
43 inode = obj->filp->f_path.dentry->d_inode; 43 inode = file_inode(obj->filp);
44 mapping = inode->i_mapping; 44 mapping = inode->i_mapping;
45 45
46 npages = obj->size >> PAGE_SHIFT; 46 npages = obj->size >> PAGE_SHIFT;
diff --git a/drivers/staging/usbip/usbip_common.c b/drivers/staging/usbip/usbip_common.c
index 75189feac380..773014c7c752 100644
--- a/drivers/staging/usbip/usbip_common.c
+++ b/drivers/staging/usbip/usbip_common.c
@@ -411,7 +411,7 @@ struct socket *sockfd_to_socket(unsigned int sockfd)
411 return NULL; 411 return NULL;
412 } 412 }
413 413
414 inode = file->f_dentry->d_inode; 414 inode = file_inode(file);
415 415
416 if (!inode || !S_ISSOCK(inode->i_mode)) { 416 if (!inode || !S_ISSOCK(inode->i_mode)) {
417 fput(file); 417 fput(file);
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 4ef852c4c4e1..869ce93ee204 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -318,7 +318,7 @@ static ssize_t buffer_from_user(unsigned int minor, const char __user *buf,
318static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count, 318static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count,
319 loff_t *ppos) 319 loff_t *ppos)
320{ 320{
321 unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev); 321 unsigned int minor = MINOR(file_inode(file)->i_rdev);
322 ssize_t retval; 322 ssize_t retval;
323 size_t image_size; 323 size_t image_size;
324 size_t okcount; 324 size_t okcount;
@@ -364,7 +364,7 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count,
364static ssize_t vme_user_write(struct file *file, const char __user *buf, 364static ssize_t vme_user_write(struct file *file, const char __user *buf,
365 size_t count, loff_t *ppos) 365 size_t count, loff_t *ppos)
366{ 366{
367 unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev); 367 unsigned int minor = MINOR(file_inode(file)->i_rdev);
368 ssize_t retval; 368 ssize_t retval;
369 size_t image_size; 369 size_t image_size;
370 size_t okcount; 370 size_t okcount;
@@ -410,7 +410,7 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf,
410static loff_t vme_user_llseek(struct file *file, loff_t off, int whence) 410static loff_t vme_user_llseek(struct file *file, loff_t off, int whence)
411{ 411{
412 loff_t absolute = -1; 412 loff_t absolute = -1;
413 unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev); 413 unsigned int minor = MINOR(file_inode(file)->i_rdev);
414 size_t image_size; 414 size_t image_size;
415 415
416 if (minor == CONTROL_MINOR) 416 if (minor == CONTROL_MINOR)
@@ -583,7 +583,7 @@ vme_user_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
583 int ret; 583 int ret;
584 584
585 mutex_lock(&vme_user_mutex); 585 mutex_lock(&vme_user_mutex);
586 ret = vme_user_ioctl(file->f_path.dentry->d_inode, file, cmd, arg); 586 ret = vme_user_ioctl(file_inode(file), file, cmd, arg);
587 mutex_unlock(&vme_user_mutex); 587 mutex_unlock(&vme_user_mutex);
588 588
589 return ret; 589 return ret;
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index b9c88497e8f0..a65d507b0b0c 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -265,7 +265,7 @@ static int fd_do_rw(struct se_cmd *cmd, struct scatterlist *sgl,
265 * the expected virt_size for struct file w/o a backing struct 265 * the expected virt_size for struct file w/o a backing struct
266 * block_device. 266 * block_device.
267 */ 267 */
268 if (S_ISBLK(fd->f_dentry->d_inode->i_mode)) { 268 if (S_ISBLK(file_inode(fd)->i_mode)) {
269 if (ret < 0 || ret != cmd->data_length) { 269 if (ret < 0 || ret != cmd->data_length) {
270 pr_err("%s() returned %d, expecting %u for " 270 pr_err("%s() returned %d, expecting %u for "
271 "S_ISBLK\n", __func__, ret, 271 "S_ISBLK\n", __func__, ret,
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index fa7268a93c06..e4ca345873c3 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -101,7 +101,7 @@ vcs_poll_data_get(struct file *file)
101 poll = kzalloc(sizeof(*poll), GFP_KERNEL); 101 poll = kzalloc(sizeof(*poll), GFP_KERNEL);
102 if (!poll) 102 if (!poll)
103 return NULL; 103 return NULL;
104 poll->cons_num = iminor(file->f_path.dentry->d_inode) & 127; 104 poll->cons_num = iminor(file_inode(file)) & 127;
105 init_waitqueue_head(&poll->waitq); 105 init_waitqueue_head(&poll->waitq);
106 poll->notifier.notifier_call = vcs_notifier; 106 poll->notifier.notifier_call = vcs_notifier;
107 if (register_vt_notifier(&poll->notifier) != 0) { 107 if (register_vt_notifier(&poll->notifier) != 0) {
@@ -182,7 +182,7 @@ static loff_t vcs_lseek(struct file *file, loff_t offset, int orig)
182 int size; 182 int size;
183 183
184 console_lock(); 184 console_lock();
185 size = vcs_size(file->f_path.dentry->d_inode); 185 size = vcs_size(file_inode(file));
186 console_unlock(); 186 console_unlock();
187 if (size < 0) 187 if (size < 0)
188 return size; 188 return size;
@@ -208,7 +208,7 @@ static loff_t vcs_lseek(struct file *file, loff_t offset, int orig)
208static ssize_t 208static ssize_t
209vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) 209vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
210{ 210{
211 struct inode *inode = file->f_path.dentry->d_inode; 211 struct inode *inode = file_inode(file);
212 unsigned int currcons = iminor(inode); 212 unsigned int currcons = iminor(inode);
213 struct vc_data *vc; 213 struct vc_data *vc;
214 struct vcs_poll_data *poll; 214 struct vcs_poll_data *poll;
@@ -386,7 +386,7 @@ unlock_out:
386static ssize_t 386static ssize_t
387vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) 387vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
388{ 388{
389 struct inode *inode = file->f_path.dentry->d_inode; 389 struct inode *inode = file_inode(file);
390 unsigned int currcons = iminor(inode); 390 unsigned int currcons = iminor(inode);
391 struct vc_data *vc; 391 struct vc_data *vc;
392 long pos; 392 long pos;
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index cbacea933b18..2c42e06f9717 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -658,7 +658,7 @@ static loff_t usb_device_lseek(struct file *file, loff_t offset, int orig)
658{ 658{
659 loff_t ret; 659 loff_t ret;
660 660
661 mutex_lock(&file->f_dentry->d_inode->i_mutex); 661 mutex_lock(&file_inode(file)->i_mutex);
662 662
663 switch (orig) { 663 switch (orig) {
664 case 0: 664 case 0:
@@ -674,7 +674,7 @@ static loff_t usb_device_lseek(struct file *file, loff_t offset, int orig)
674 ret = -EINVAL; 674 ret = -EINVAL;
675 } 675 }
676 676
677 mutex_unlock(&file->f_dentry->d_inode->i_mutex); 677 mutex_unlock(&file_inode(file)->i_mutex);
678 return ret; 678 return ret;
679} 679}
680 680
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index b78fbe222b72..6e8af6ddb5f7 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -160,7 +160,7 @@ static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig)
160{ 160{
161 loff_t ret; 161 loff_t ret;
162 162
163 mutex_lock(&file->f_dentry->d_inode->i_mutex); 163 mutex_lock(&file_inode(file)->i_mutex);
164 164
165 switch (orig) { 165 switch (orig) {
166 case 0: 166 case 0:
@@ -176,7 +176,7 @@ static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig)
176 ret = -EINVAL; 176 ret = -EINVAL;
177 } 177 }
178 178
179 mutex_unlock(&file->f_dentry->d_inode->i_mutex); 179 mutex_unlock(&file_inode(file)->i_mutex);
180 return ret; 180 return ret;
181} 181}
182 182
@@ -1970,7 +1970,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
1970 void __user *p) 1970 void __user *p)
1971{ 1971{
1972 struct dev_state *ps = file->private_data; 1972 struct dev_state *ps = file->private_data;
1973 struct inode *inode = file->f_path.dentry->d_inode; 1973 struct inode *inode = file_inode(file);
1974 struct usb_device *dev = ps->dev; 1974 struct usb_device *dev = ps->dev;
1975 int ret = -ENOTTY; 1975 int ret = -ENOTTY;
1976 1976
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index a7aed84d98c9..fd49dba53613 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -93,7 +93,7 @@ static ssize_t queue_dbg_read(struct file *file, char __user *buf,
93 if (!access_ok(VERIFY_WRITE, buf, nbytes)) 93 if (!access_ok(VERIFY_WRITE, buf, nbytes))
94 return -EFAULT; 94 return -EFAULT;
95 95
96 mutex_lock(&file->f_dentry->d_inode->i_mutex); 96 mutex_lock(&file_inode(file)->i_mutex);
97 list_for_each_entry_safe(req, tmp_req, queue, queue) { 97 list_for_each_entry_safe(req, tmp_req, queue, queue) {
98 len = snprintf(tmpbuf, sizeof(tmpbuf), 98 len = snprintf(tmpbuf, sizeof(tmpbuf),
99 "%8p %08x %c%c%c %5d %c%c%c\n", 99 "%8p %08x %c%c%c %5d %c%c%c\n",
@@ -120,7 +120,7 @@ static ssize_t queue_dbg_read(struct file *file, char __user *buf,
120 nbytes -= len; 120 nbytes -= len;
121 buf += len; 121 buf += len;
122 } 122 }
123 mutex_unlock(&file->f_dentry->d_inode->i_mutex); 123 mutex_unlock(&file_inode(file)->i_mutex);
124 124
125 return actual; 125 return actual;
126} 126}
@@ -168,13 +168,13 @@ out:
168static ssize_t regs_dbg_read(struct file *file, char __user *buf, 168static ssize_t regs_dbg_read(struct file *file, char __user *buf,
169 size_t nbytes, loff_t *ppos) 169 size_t nbytes, loff_t *ppos)
170{ 170{
171 struct inode *inode = file->f_dentry->d_inode; 171 struct inode *inode = file_inode(file);
172 int ret; 172 int ret;
173 173
174 mutex_lock(&inode->i_mutex); 174 mutex_lock(&inode->i_mutex);
175 ret = simple_read_from_buffer(buf, nbytes, ppos, 175 ret = simple_read_from_buffer(buf, nbytes, ppos,
176 file->private_data, 176 file->private_data,
177 file->f_dentry->d_inode->i_size); 177 file_inode(file)->i_size);
178 mutex_unlock(&inode->i_mutex); 178 mutex_unlock(&inode->i_mutex);
179 179
180 return ret; 180 return ret;
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 5d027b3e1ef0..50a46a429efb 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -992,7 +992,7 @@ static int do_synchronize_cache(struct fsg_common *common)
992static void invalidate_sub(struct fsg_lun *curlun) 992static void invalidate_sub(struct fsg_lun *curlun)
993{ 993{
994 struct file *filp = curlun->filp; 994 struct file *filp = curlun->filp;
995 struct inode *inode = filp->f_path.dentry->d_inode; 995 struct inode *inode = file_inode(filp);
996 unsigned long rc; 996 unsigned long rc;
997 997
998 rc = invalidate_mapping_pages(inode->i_mapping, 0, -1); 998 rc = invalidate_mapping_pages(inode->i_mapping, 0, -1);
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c
index 35bcc83d1e04..bf7a56b6d48a 100644
--- a/drivers/usb/gadget/printer.c
+++ b/drivers/usb/gadget/printer.c
@@ -688,7 +688,7 @@ static int
688printer_fsync(struct file *fd, loff_t start, loff_t end, int datasync) 688printer_fsync(struct file *fd, loff_t start, loff_t end, int datasync)
689{ 689{
690 struct printer_dev *dev = fd->private_data; 690 struct printer_dev *dev = fd->private_data;
691 struct inode *inode = fd->f_path.dentry->d_inode; 691 struct inode *inode = file_inode(fd);
692 unsigned long flags; 692 unsigned long flags;
693 int tx_list_empty; 693 int tx_list_empty;
694 694
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index e4192b887de9..d9297eebbf73 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -1065,7 +1065,7 @@ static int rndis_proc_show(struct seq_file *m, void *v)
1065static ssize_t rndis_proc_write(struct file *file, const char __user *buffer, 1065static ssize_t rndis_proc_write(struct file *file, const char __user *buffer,
1066 size_t count, loff_t *ppos) 1066 size_t count, loff_t *ppos)
1067{ 1067{
1068 rndis_params *p = PDE(file->f_path.dentry->d_inode)->data; 1068 rndis_params *p = PDE(file_inode(file))->data;
1069 u32 speed = 0; 1069 u32 speed = 0;
1070 int i, fl_speed = 0; 1070 int i, fl_speed = 0;
1071 1071
diff --git a/drivers/usb/gadget/storage_common.c b/drivers/usb/gadget/storage_common.c
index 0e3ae43454a2..b5d3f0eeeb7d 100644
--- a/drivers/usb/gadget/storage_common.c
+++ b/drivers/usb/gadget/storage_common.c
@@ -501,7 +501,7 @@ static int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
501 if (!(filp->f_mode & FMODE_WRITE)) 501 if (!(filp->f_mode & FMODE_WRITE))
502 ro = 1; 502 ro = 1;
503 503
504 inode = filp->f_path.dentry->d_inode; 504 inode = file_inode(filp);
505 if ((!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) { 505 if ((!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) {
506 LINFO(curlun, "invalid file type: %s\n", filename); 506 LINFO(curlun, "invalid file type: %s\n", filename);
507 goto out; 507 goto out;
diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c
index 88cad6b8b479..900aa4ecd617 100644
--- a/drivers/video/fb_defio.c
+++ b/drivers/video/fb_defio.c
@@ -69,7 +69,7 @@ static int fb_deferred_io_fault(struct vm_area_struct *vma,
69int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasync) 69int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasync)
70{ 70{
71 struct fb_info *info = file->private_data; 71 struct fb_info *info = file->private_data;
72 struct inode *inode = file->f_path.dentry->d_inode; 72 struct inode *inode = file_inode(file);
73 int err = filemap_write_and_wait_range(inode->i_mapping, start, end); 73 int err = filemap_write_and_wait_range(inode->i_mapping, start, end);
74 if (err) 74 if (err)
75 return err; 75 return err;
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 3ff0105a496a..bf01980c9554 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -727,7 +727,7 @@ static const struct file_operations fb_proc_fops = {
727 */ 727 */
728static struct fb_info *file_fb_info(struct file *file) 728static struct fb_info *file_fb_info(struct file *file)
729{ 729{
730 struct inode *inode = file->f_path.dentry->d_inode; 730 struct inode *inode = file_inode(file);
731 int fbidx = iminor(inode); 731 int fbidx = iminor(inode);
732 struct fb_info *info = registered_fb[fbidx]; 732 struct fb_info *info = registered_fb[fbidx];
733 733
diff --git a/drivers/video/msm/mdp.c b/drivers/video/msm/mdp.c
index f2566c19e71c..113c7876c855 100644
--- a/drivers/video/msm/mdp.c
+++ b/drivers/video/msm/mdp.c
@@ -261,7 +261,7 @@ int get_img(struct mdp_img *img, struct fb_info *info,
261 if (f.file == NULL) 261 if (f.file == NULL)
262 return -1; 262 return -1;
263 263
264 if (MAJOR(f.file->f_dentry->d_inode->i_rdev) == FB_MAJOR) { 264 if (MAJOR(file_inode(f.file)->i_rdev) == FB_MAJOR) {
265 *start = info->fix.smem_start; 265 *start = info->fix.smem_start;
266 *len = info->fix.smem_len; 266 *len = info->fix.smem_len;
267 } else 267 } else
diff --git a/drivers/watchdog/cpwd.c b/drivers/watchdog/cpwd.c
index 11d55ce5ca81..70387582843f 100644
--- a/drivers/watchdog/cpwd.c
+++ b/drivers/watchdog/cpwd.c
@@ -411,7 +411,7 @@ static long cpwd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
411 .identity = DRIVER_NAME, 411 .identity = DRIVER_NAME,
412 }; 412 };
413 void __user *argp = (void __user *)arg; 413 void __user *argp = (void __user *)arg;
414 struct inode *inode = file->f_path.dentry->d_inode; 414 struct inode *inode = file_inode(file);
415 int index = iminor(inode) - WD0_MINOR; 415 int index = iminor(inode) - WD0_MINOR;
416 struct cpwd *p = cpwd_device; 416 struct cpwd *p = cpwd_device;
417 int setopt = 0; 417 int setopt = 0;
@@ -499,7 +499,7 @@ static long cpwd_compat_ioctl(struct file *file, unsigned int cmd,
499static ssize_t cpwd_write(struct file *file, const char __user *buf, 499static ssize_t cpwd_write(struct file *file, const char __user *buf,
500 size_t count, loff_t *ppos) 500 size_t count, loff_t *ppos)
501{ 501{
502 struct inode *inode = file->f_path.dentry->d_inode; 502 struct inode *inode = file_inode(file);
503 struct cpwd *p = cpwd_device; 503 struct cpwd *p = cpwd_device;
504 int index = iminor(inode); 504 int index = iminor(inode);
505 505
diff --git a/drivers/zorro/proc.c b/drivers/zorro/proc.c
index 988880dcee75..73b33837e12c 100644
--- a/drivers/zorro/proc.c
+++ b/drivers/zorro/proc.c
@@ -22,7 +22,7 @@ static loff_t
22proc_bus_zorro_lseek(struct file *file, loff_t off, int whence) 22proc_bus_zorro_lseek(struct file *file, loff_t off, int whence)
23{ 23{
24 loff_t new = -1; 24 loff_t new = -1;
25 struct inode *inode = file->f_path.dentry->d_inode; 25 struct inode *inode = file_inode(file);
26 26
27 mutex_lock(&inode->i_mutex); 27 mutex_lock(&inode->i_mutex);
28 switch (whence) { 28 switch (whence) {
@@ -47,7 +47,7 @@ proc_bus_zorro_lseek(struct file *file, loff_t off, int whence)
47static ssize_t 47static ssize_t
48proc_bus_zorro_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) 48proc_bus_zorro_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
49{ 49{
50 struct inode *ino = file->f_path.dentry->d_inode; 50 struct inode *ino = file_inode(file);
51 struct proc_dir_entry *dp = PDE(ino); 51 struct proc_dir_entry *dp = PDE(ino);
52 struct zorro_dev *z = dp->data; 52 struct zorro_dev *z = dp->data;
53 struct ConfigDev cd; 53 struct ConfigDev cd;
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:
133static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl) 133static 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
303static int v9fs_file_lock_dotl(struct file *filp, int cmd, struct file_lock *fl) 303static 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:
338static int v9fs_file_flock_dotl(struct file *filp, int cmd, 338static 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);
19static int 19static int
20adfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 20adfs_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 = {
42static int 42static int
43affs_readdir(struct file *filp, void *dirent, filldir_t filldir) 43affs_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 */
515int afs_lock(struct file *file, int cmd, struct file_lock *fl) 515int 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 */
538int afs_flock(struct file *file, int cmd, struct file_lock *fl) 538int 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)
627ssize_t afs_file_write(struct kiocb *iocb, const struct iovec *iov, 627ssize_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,
874static long autofs4_root_ioctl(struct file *filp, 874static 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,
882static long autofs4_root_compat_ioctl(struct file *filp, 882static 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)
213static int 213static int
214befs_readdir(struct file *filp, void *dirent, filldir_t filldir) 214befs_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
29static int bfs_readdir(struct file *f, void *dirent, filldir_t filldir) 29static 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
910dynamic_error: 910dynamic_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)
531static ssize_t 531static ssize_t
532bm_entry_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) 532bm_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 */
324static loff_t block_llseek(struct file *file, loff_t offset, int whence) 324static 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:
2087static long btrfs_fallocate(struct file *file, int mode, 2087static 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[] = {
4342static int btrfs_real_readdir(struct file *filp, void *dirent, 4342static 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)
6737int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 6737int 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
153static int btrfs_ioctl_getflags(struct file *file, void __user *arg) 153static 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
178static int btrfs_ioctl_setflags(struct file *file, void __user *arg) 178static 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
311static int btrfs_ioctl_getversion(struct file *file, int __user *arg) 311static 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:
1576static noinline int btrfs_ioctl_subvol_getflags(struct file *file, 1576static 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,
1598static noinline int btrfs_ioctl_subvol_setflags(struct file *file, 1598static 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
2179static int btrfs_ioctl_defrag(struct file *file, void __user *argp) 2179static 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
2286static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg) 2286static 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:
2408static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, 2408static 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 */
2817static long btrfs_ioctl_trans_start(struct file *file) 2817static 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
2857static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) 2857static 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 */
3081long btrfs_ioctl_trans_end(struct file *file) 3081long 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
3143static long btrfs_ioctl_scrub(struct file *file, void __user *arg) 3143static 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
3434static long btrfs_ioctl_balance(struct file *file, void __user *arg) 3434static 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
3574static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg) 3574static 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
3633static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg) 3633static 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
3680static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg) 3680static 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
3726static long btrfs_ioctl_qgroup_limit(struct file *file, void __user *arg) 3726static 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:
3855long btrfs_ioctl(struct file *file, unsigned int 3855long 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 */
196static int readpage_nounlock(struct file *filp, struct page *page) 196static 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:
370static int ceph_readpages(struct file *file, struct address_space *mapping, 370static 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 */
1229static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 1229static 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,
238static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir) 238static 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,
1188static int ceph_dir_fsync(struct file *file, loff_t start, loff_t end, 1188static 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:
393static ssize_t ceph_sync_read(struct file *file, char __user *data, 393static 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,
466static ssize_t ceph_sync_write(struct file *file, const char __user *data, 466static 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 */
17static long ceph_ioctl_get_layout(struct file *file, void __user *arg) 17static 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
64static long ceph_ioctl_set_layout(struct file *file, void __user *arg) 64static 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 */
137static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg) 137static 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)
179static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) 179static 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)
234static long ceph_ioctl_lazyio(struct file *file) 234static 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 @@
13static int ceph_lock_message(u8 lock_type, u16 operation, struct file *file, 13static 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:
677static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov, 677static 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
947cifs_posix_lock_test(struct file *file, struct file_lock *flock) 947cifs_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)
974static int 974static int
975cifs_posix_lock_set(struct file *file, struct file_lock *flock) 975cifs_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 */
2247int cifs_flush(struct file *file, fl_owner_t id) 2247int 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
2543cifs_strict_writev(struct kiocb *iocb, const struct iovec *iov, 2543cifs_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
2915cifs_strict_readv(struct kiocb *iocb, const struct iovec *iov, 2915cifs_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 = {
3063int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma) 3063int 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)
1678int cifs_revalidate_file_attr(struct file *filp) 1678int 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:
1735int cifs_revalidate_file(struct file *filp) 1735int 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
31long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) 31long 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 */
506static int is_dir_changed(struct file *file) 506static 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,
66static ssize_t 66static ssize_t
67coda_file_write(struct file *coda_file, const char __user *buf, size_t count, loff_t *ppos) 67coda_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)
202int coda_fsync(struct file *coda_file, loff_t start, loff_t end, int datasync) 202int 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 */
352static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 352static 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));
137out: 137out:
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
22static int efs_readdir(struct file *filp, void *dirent, filldir_t filldir) { 22static 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;
diff --git a/fs/exec.c b/fs/exec.c
index 20df02c1cc70..7b6f4d59b26c 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -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
1099void would_dump(struct linux_binprm *bprm, struct file *file) 1099void 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}
1104EXPORT_SYMBOL(would_dump); 1104EXPORT_SYMBOL(would_dump);
@@ -1270,7 +1270,7 @@ static int check_unsafe_exec(struct linux_binprm *bprm)
1270int prepare_binprm(struct linux_binprm *bprm) 1270int 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
242exofs_readdir(struct file *filp, void *dirent, filldir_t filldir) 242exofs_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
290ext2_readdir (struct file * filp, void * dirent, filldir_t filldir) 290ext2_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
20long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 20long 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
15long ext3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 15long 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 */
4387long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len) 4387long 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 */
4644int ext4_ext_punch_hole(struct file *file, loff_t offset, loff_t length) 4644int 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
167ext4_file_write(struct kiocb *iocb, const struct iovec *iov, 167ext4_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
3554int ext4_punch_hole(struct file *file, loff_t offset, loff_t length) 3554int 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
23long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 23long 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)
603static int f2fs_readdir(struct file *file, void *dirent, filldir_t filldir) 603static 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
699static int fat_readdir(struct file *filp, void *dirent, filldir_t filldir) 699static 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,
779static long fat_dir_ioctl(struct file *filp, unsigned int cmd, 779static 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)
819static long fat_compat_dir_ioctl(struct file *filp, unsigned cmd, 819static 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
33static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr) 33static 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
117long fat_generic_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 117long 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
31static int setfl(int fd, struct file * filp, unsigned long arg) 31static 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)
237static int 237static int
238vxfs_readdir(struct file *fp, void *retp, filldir_t filler) 238vxfs_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
158static int gfs2_get_flags(struct file *filp, u32 __user *ptr) 158static 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 */
218static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask) 218static 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
294static int gfs2_set_flags(struct file *filp, u32 __user *ptr) 294static 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
337static void gfs2_size_hint(struct file *filep, loff_t offset, size_t size) 337static 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)
386static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 386static 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,
772static long gfs2_fallocate(struct file *file, int mode, loff_t offset, 771static 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
1258int gfs2_fitrim(struct file *filp, void __user *argp) 1258int 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 */
52static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 52static 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
123static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) 123static 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
60static int hfsplus_ioctl_getflags(struct file *file, int __user *user_flags) 60static 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
76static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags) 76static 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
35static int hostfs_d_delete(const struct dentry *dentry) 35static 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
58static int hpfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 58static 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
98static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma) 98static 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
1656int file_update_time(struct file *file) 1656int 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 */
425int ioctl_preallocate(struct file *filp, void __user *argp) 425int 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)
449static int file_ioctl(struct file *filp, unsigned int cmd, 449static 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
513static int ioctl_fsfreeze(struct file *filp) 513static 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
528static int ioctl_fsthaw(struct file *filp) 528static 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 */
297static int zisofs_readpage(struct file *file, struct page *page) 297static 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,
117static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir) 117static 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
59long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 59long 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 */
3005int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 3005int 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
46static inline void nlm_debug_print_file(char *msg, struct nlm_file *file) 46static 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
1002int posix_lock_file(struct file *filp, struct file_lock *fl, 1002int 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}
1007EXPORT_SYMBOL(posix_lock_file); 1007EXPORT_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 */
2057void locks_remove_flock(struct file *filp) 2057void 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
285static int __logfs_readdir(struct file *file, void *buf, filldir_t filldir) 285static 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
321static int logfs_readdir(struct file *file, void *buf, filldir_t filldir) 321static 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
184long logfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 184long 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)
85static int minix_readdir(struct file * filp, void * dirent, filldir_t filldir) 85static 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 */
385int __mnt_want_write_file(struct file *file) 385int __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
809long ncp_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 809long 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 */
106int ncp_mmap(struct file *file, struct vm_area_struct *vma) 106int 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:
629static 629static
630int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page* page) 630int 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)
660static 660static
661struct page *get_cache_page(nfs_readdir_descriptor_t *desc) 661struct 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
292nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) 292nfs_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:
764static ssize_t 764static ssize_t
765idmap_pipe_downcall(struct file *filp, const char __user *src, size_t mlen) 765idmap_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 */
715void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx) 715void 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
748static void nfs_file_clear_open_context(struct file *filp) 748static 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
872static int 872static int
873nfs3_proc_lock(struct file *filp, int cmd, struct file_lock *fl) 873nfs3_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
94nfs4_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) 94nfs4_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)
662static int 662static int
663nfs_proc_lock(struct file *filp, int cmd, struct file_lock *fl) 663nfs_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
86static ssize_t nfsctl_transaction_write(struct file *file, const char __user *buf, size_t size, loff_t *pos) 86static 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 */
980static int wait_for_concurrent_writes(struct file *file) 980static 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)
259static int nilfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 259static 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)
67static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 67static 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
794long nilfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 794long 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,
2015int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir) 2015int 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)
224static unsigned int dlmfs_file_poll(struct file *file, poll_table *wait) 224static 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:
1949int ocfs2_change_file_space(struct file *file, unsigned int cmd, 1949int 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,
1977static long ocfs2_fallocate(struct file *file, int mode, loff_t offset, 1977static 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
882long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 882long 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:
131static int ocfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 131static 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);
190out: 190out:
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,
330static int omfs_fill_chain(struct file *filp, void *dirent, filldir_t filldir, 330static 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
406static int omfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 406static 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;
diff --git a/fs/open.c b/fs/open.c
index 9b33c0cbfacf..e08643feb574 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -228,7 +228,7 @@ SYSCALL_ALIAS(sys_ftruncate64, SyS_ftruncate64);
228 228
229int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len) 229int 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
263static int openpromfs_readdir(struct file * filp, void * dirent, filldir_t filldir) 263static 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;
diff --git a/fs/pipe.c b/fs/pipe.c
index bd3479db4b62..39baf6c3ebb0 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -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
678static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 678static 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
705pipe_poll(struct file *filp, poll_table *wait) 705pipe_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)
758static int 758static int
759pipe_read_fasync(int fd, struct file *filp, int on) 759pipe_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)
772static int 772static int
773pipe_write_fasync(int fd, struct file *filp, int on) 773pipe_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)
786static int 786static int
787pipe_rdwr_fasync(int fd, struct file *filp, int on) 787pipe_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 */
1227struct pipe_inode_info *get_pipe_info(struct file *file) 1227struct 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)
383static ssize_t lstats_write(struct file *file, const char __user *buf, 383static 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 = {
602static ssize_t proc_info_read(struct file * file, char __user * buf, 602static 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
669static int __mem_open(struct inode *inode, struct file *file, unsigned int mode) 669static 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 = {
869static ssize_t oom_adj_read(struct file *file, char __user *buf, size_t count, 869static 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 = {
976static ssize_t oom_score_adj_read(struct file *file, char __user *buf, 976static 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 = {
1067static ssize_t proc_loginuid_read(struct file * file, char __user * buf, 1067static 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,
1084static ssize_t proc_loginuid_write(struct file * file, const char __user * buf, 1084static 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 = {
1142static ssize_t proc_sessionid_read(struct file * file, char __user * buf, 1142static 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 = {
1165static ssize_t proc_fault_inject_read(struct file * file, char __user * buf, 1165static 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
1237sched_write(struct file *file, const char __user *buf, 1237sched_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
1288sched_autogroup_write(struct file *file, const char __user *buf, 1288sched_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 = {
1343static ssize_t comm_write(struct file *file, const char __user *buf, 1343static 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:
2146static ssize_t proc_pid_attr_read(struct file * file, char __user * buf, 2146static 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,
2167static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf, 2167static 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 = {
2256static ssize_t proc_coredump_filter_read(struct file *file, char __user *buf, 2256static 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
188proc_file_read(struct file *file, char __user *buf, size_t nbytes, 188proc_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
209proc_file_write(struct file *file, const char __user *buffer, 209proc_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
523int proc_readdir(struct file *filp, void *dirent, filldir_t filldir) 523int 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
145static loff_t proc_reg_llseek(struct file *file, loff_t offset, int whence) 145static 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
180static ssize_t proc_reg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) 180static 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
202static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) 202static 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
224static unsigned int proc_reg_poll(struct file *file, struct poll_table_struct *pts) 224static 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
246static long proc_reg_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 246static 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
269static long proc_reg_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 269static 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
292static int proc_reg_mmap(struct file *file, struct vm_area_struct *vma) 292static 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:
478static ssize_t proc_sys_call_handler(struct file *filp, void __user *buf, 478static 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
543static unsigned int proc_sys_poll(struct file *filp, poll_table *wait) 543static 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,
1015static ssize_t pagemap_read(struct file *file, char __user *buf, 1015static 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
17static int qnx4_readdir(struct file *filp, void *dirent, filldir_t filldir) 17static 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
118static int qnx6_readdir(struct file *filp, void *dirent, filldir_t filldir) 118static 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
164loff_t default_llseek(struct file *file, loff_t offset, int whence) 164loff_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
23int vfs_readdir(struct file *file, filldir_t filler, void *buf) 23int 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 */
22long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 22long 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 */
148static int romfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 148static 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
103static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) 103static 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,
diff --git a/fs/sync.c b/fs/sync.c
index 14eefeb44636..2c5d6639a66a 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -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
70read(struct file *file, char __user *userbuf, size_t bytes, loff_t *off) 70read(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)
68static int sysv_readdir(struct file * filp, void * dirent, filldir_t filldir) 68static 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:
147long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 147long 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
187static int udf_readdir(struct file *filp, void *dirent, filldir_t filldir) 187static 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
179long udf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 179long 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
433ufs_readdir(struct file *filp, void *dirent, filldir_t filldir) 433ufs_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;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7617ee04f066..3ab69777b4d8 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2217,6 +2217,11 @@ static inline bool execute_ok(struct inode *inode)
2217 return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); 2217 return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode);
2218} 2218}
2219 2219
2220static inline struct inode *file_inode(struct file *f)
2221{
2222 return f->f_path.dentry->d_inode;
2223}
2224
2220/* 2225/*
2221 * get_write_access() gets write permission for a file. 2226 * get_write_access() gets write permission for a file.
2222 * put_write_access() releases this write permission. 2227 * put_write_access() releases this write permission.
@@ -2239,7 +2244,7 @@ static inline int get_write_access(struct inode *inode)
2239} 2244}
2240static inline int deny_write_access(struct file *file) 2245static inline int deny_write_access(struct file *file)
2241{ 2246{
2242 struct inode *inode = file->f_path.dentry->d_inode; 2247 struct inode *inode = file_inode(file);
2243 return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -ETXTBSY; 2248 return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -ETXTBSY;
2244} 2249}
2245static inline void put_write_access(struct inode * inode) 2250static inline void put_write_access(struct inode * inode)
@@ -2249,7 +2254,7 @@ static inline void put_write_access(struct inode * inode)
2249static inline void allow_write_access(struct file *file) 2254static inline void allow_write_access(struct file *file)
2250{ 2255{
2251 if (file) 2256 if (file)
2252 atomic_inc(&file->f_path.dentry->d_inode->i_writecount); 2257 atomic_inc(&file_inode(file)->i_writecount);
2253} 2258}
2254#ifdef CONFIG_IMA 2259#ifdef CONFIG_IMA
2255static inline void i_readcount_dec(struct inode *inode) 2260static inline void i_readcount_dec(struct inode *inode)
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index 0fbfb4646d1b..a78680a92dba 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -244,7 +244,7 @@ static inline void fsnotify_open(struct file *file)
244static inline void fsnotify_close(struct file *file) 244static inline void fsnotify_close(struct file *file)
245{ 245{
246 struct path *path = &file->f_path; 246 struct path *path = &file->f_path;
247 struct inode *inode = file->f_path.dentry->d_inode; 247 struct inode *inode = file_inode(file);
248 fmode_t mode = file->f_mode; 248 fmode_t mode = file->f_mode;
249 __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE; 249 __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE;
250 250
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 0c80d3f57a5b..70832951f97c 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -281,7 +281,7 @@ static inline struct hstate *hstate_inode(struct inode *i)
281 281
282static inline struct hstate *hstate_file(struct file *f) 282static inline struct hstate *hstate_file(struct file *f)
283{ 283{
284 return hstate_inode(f->f_dentry->d_inode); 284 return hstate_inode(file_inode(f));
285} 285}
286 286
287static inline struct hstate *hstate_vma(struct vm_area_struct *vma) 287static inline struct hstate *hstate_vma(struct vm_area_struct *vma)
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index f5a051a79273..0e62d84f9f7f 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -291,7 +291,7 @@ int nlmsvc_unlock_all_by_ip(struct sockaddr *server_addr);
291 291
292static inline struct inode *nlmsvc_file_inode(struct nlm_file *file) 292static inline struct inode *nlmsvc_file_inode(struct nlm_file *file)
293{ 293{
294 return file->f_file->f_path.dentry->d_inode; 294 return file_inode(file->f_file);
295} 295}
296 296
297static inline int __nlm_privileged_request4(const struct sockaddr *sap) 297static inline int __nlm_privileged_request4(const struct sockaddr *sap)
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 71a3ca18c873..963a8709f5fb 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -477,7 +477,7 @@ static int mqueue_unlink(struct inode *dir, struct dentry *dentry)
477static ssize_t mqueue_read_file(struct file *filp, char __user *u_data, 477static ssize_t mqueue_read_file(struct file *filp, char __user *u_data,
478 size_t count, loff_t *off) 478 size_t count, loff_t *off)
479{ 479{
480 struct mqueue_inode_info *info = MQUEUE_I(filp->f_path.dentry->d_inode); 480 struct mqueue_inode_info *info = MQUEUE_I(file_inode(filp));
481 char buffer[FILENT_SIZE]; 481 char buffer[FILENT_SIZE];
482 ssize_t ret; 482 ssize_t ret;
483 483
@@ -498,13 +498,13 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data,
498 if (ret <= 0) 498 if (ret <= 0)
499 return ret; 499 return ret;
500 500
501 filp->f_path.dentry->d_inode->i_atime = filp->f_path.dentry->d_inode->i_ctime = CURRENT_TIME; 501 file_inode(filp)->i_atime = file_inode(filp)->i_ctime = CURRENT_TIME;
502 return ret; 502 return ret;
503} 503}
504 504
505static int mqueue_flush_file(struct file *filp, fl_owner_t id) 505static int mqueue_flush_file(struct file *filp, fl_owner_t id)
506{ 506{
507 struct mqueue_inode_info *info = MQUEUE_I(filp->f_path.dentry->d_inode); 507 struct mqueue_inode_info *info = MQUEUE_I(file_inode(filp));
508 508
509 spin_lock(&info->lock); 509 spin_lock(&info->lock);
510 if (task_tgid(current) == info->notify_owner) 510 if (task_tgid(current) == info->notify_owner)
@@ -516,7 +516,7 @@ static int mqueue_flush_file(struct file *filp, fl_owner_t id)
516 516
517static unsigned int mqueue_poll_file(struct file *filp, struct poll_table_struct *poll_tab) 517static unsigned int mqueue_poll_file(struct file *filp, struct poll_table_struct *poll_tab)
518{ 518{
519 struct mqueue_inode_info *info = MQUEUE_I(filp->f_path.dentry->d_inode); 519 struct mqueue_inode_info *info = MQUEUE_I(file_inode(filp));
520 int retval = 0; 520 int retval = 0;
521 521
522 poll_wait(filp, &info->wait_q, poll_tab); 522 poll_wait(filp, &info->wait_q, poll_tab);
@@ -973,7 +973,7 @@ SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr,
973 goto out; 973 goto out;
974 } 974 }
975 975
976 inode = f.file->f_path.dentry->d_inode; 976 inode = file_inode(f.file);
977 if (unlikely(f.file->f_op != &mqueue_file_operations)) { 977 if (unlikely(f.file->f_op != &mqueue_file_operations)) {
978 ret = -EBADF; 978 ret = -EBADF;
979 goto out_fput; 979 goto out_fput;
@@ -1089,7 +1089,7 @@ SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr,
1089 goto out; 1089 goto out;
1090 } 1090 }
1091 1091
1092 inode = f.file->f_path.dentry->d_inode; 1092 inode = file_inode(f.file);
1093 if (unlikely(f.file->f_op != &mqueue_file_operations)) { 1093 if (unlikely(f.file->f_op != &mqueue_file_operations)) {
1094 ret = -EBADF; 1094 ret = -EBADF;
1095 goto out_fput; 1095 goto out_fput;
@@ -1249,7 +1249,7 @@ retry:
1249 goto out; 1249 goto out;
1250 } 1250 }
1251 1251
1252 inode = f.file->f_path.dentry->d_inode; 1252 inode = file_inode(f.file);
1253 if (unlikely(f.file->f_op != &mqueue_file_operations)) { 1253 if (unlikely(f.file->f_op != &mqueue_file_operations)) {
1254 ret = -EBADF; 1254 ret = -EBADF;
1255 goto out_fput; 1255 goto out_fput;
@@ -1323,7 +1323,7 @@ SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes,
1323 goto out; 1323 goto out;
1324 } 1324 }
1325 1325
1326 inode = f.file->f_path.dentry->d_inode; 1326 inode = file_inode(f.file);
1327 if (unlikely(f.file->f_op != &mqueue_file_operations)) { 1327 if (unlikely(f.file->f_op != &mqueue_file_operations)) {
1328 ret = -EBADF; 1328 ret = -EBADF;
1329 goto out_fput; 1329 goto out_fput;
diff --git a/ipc/shm.c b/ipc/shm.c
index 4fa6d8fee730..8c9402d298a0 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -193,7 +193,7 @@ static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp)
193 if (!is_file_hugepages(shp->shm_file)) 193 if (!is_file_hugepages(shp->shm_file))
194 shmem_lock(shp->shm_file, 0, shp->mlock_user); 194 shmem_lock(shp->shm_file, 0, shp->mlock_user);
195 else if (shp->mlock_user) 195 else if (shp->mlock_user)
196 user_shm_unlock(shp->shm_file->f_path.dentry->d_inode->i_size, 196 user_shm_unlock(file_inode(shp->shm_file)->i_size,
197 shp->mlock_user); 197 shp->mlock_user);
198 fput (shp->shm_file); 198 fput (shp->shm_file);
199 security_shm_free(shp); 199 security_shm_free(shp);
@@ -529,7 +529,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
529 * shmid gets reported as "inode#" in /proc/pid/maps. 529 * shmid gets reported as "inode#" in /proc/pid/maps.
530 * proc-ps tools use this. Changing this will break them. 530 * proc-ps tools use this. Changing this will break them.
531 */ 531 */
532 file->f_dentry->d_inode->i_ino = shp->shm_perm.id; 532 file_inode(file)->i_ino = shp->shm_perm.id;
533 533
534 ns->shm_tot += numpages; 534 ns->shm_tot += numpages;
535 error = shp->shm_perm.id; 535 error = shp->shm_perm.id;
@@ -678,7 +678,7 @@ static void shm_add_rss_swap(struct shmid_kernel *shp,
678{ 678{
679 struct inode *inode; 679 struct inode *inode;
680 680
681 inode = shp->shm_file->f_path.dentry->d_inode; 681 inode = file_inode(shp->shm_file);
682 682
683 if (is_file_hugepages(shp->shm_file)) { 683 if (is_file_hugepages(shp->shm_file)) {
684 struct address_space *mapping = inode->i_mapping; 684 struct address_space *mapping = inode->i_mapping;
@@ -1173,7 +1173,7 @@ SYSCALL_DEFINE1(shmdt, char __user *, shmaddr)
1173 (vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) { 1173 (vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) {
1174 1174
1175 1175
1176 size = vma->vm_file->f_path.dentry->d_inode->i_size; 1176 size = file_inode(vma->vm_file)->i_size;
1177 do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start); 1177 do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start);
1178 /* 1178 /*
1179 * We discovered the size of the shm segment, so 1179 * We discovered the size of the shm segment, so
diff --git a/kernel/acct.c b/kernel/acct.c
index 051e071a06e7..0d2981358e08 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -205,7 +205,7 @@ static int acct_on(struct filename *pathname)
205 if (IS_ERR(file)) 205 if (IS_ERR(file))
206 return PTR_ERR(file); 206 return PTR_ERR(file);
207 207
208 if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) { 208 if (!S_ISREG(file_inode(file)->i_mode)) {
209 filp_close(file, NULL); 209 filp_close(file, NULL);
210 return -EACCES; 210 return -EACCES;
211 } 211 }
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 4855892798fd..4fe52b3b6ef6 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2637,7 +2637,7 @@ static struct dentry *cgroup_lookup(struct inode *dir, struct dentry *dentry, un
2637 */ 2637 */
2638static inline struct cftype *__file_cft(struct file *file) 2638static inline struct cftype *__file_cft(struct file *file)
2639{ 2639{
2640 if (file->f_dentry->d_inode->i_fop != &cgroup_file_operations) 2640 if (file_inode(file)->i_fop != &cgroup_file_operations)
2641 return ERR_PTR(-EINVAL); 2641 return ERR_PTR(-EINVAL);
2642 return __d_cft(file->f_dentry); 2642 return __d_cft(file->f_dentry);
2643} 2643}
@@ -3852,7 +3852,7 @@ static int cgroup_write_event_control(struct cgroup *cgrp, struct cftype *cft,
3852 3852
3853 /* the process need read permission on control file */ 3853 /* the process need read permission on control file */
3854 /* AV: shouldn't we check that it's been opened for read instead? */ 3854 /* AV: shouldn't we check that it's been opened for read instead? */
3855 ret = inode_permission(cfile->f_path.dentry->d_inode, MAY_READ); 3855 ret = inode_permission(file_inode(cfile), MAY_READ);
3856 if (ret < 0) 3856 if (ret < 0)
3857 goto fail; 3857 goto fail;
3858 3858
@@ -5441,7 +5441,7 @@ struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id)
5441 struct inode *inode; 5441 struct inode *inode;
5442 struct cgroup_subsys_state *css; 5442 struct cgroup_subsys_state *css;
5443 5443
5444 inode = f->f_dentry->d_inode; 5444 inode = file_inode(f);
5445 /* check in cgroup filesystem dir */ 5445 /* check in cgroup filesystem dir */
5446 if (inode->i_op != &cgroup_dir_inode_operations) 5446 if (inode->i_op != &cgroup_dir_inode_operations)
5447 return ERR_PTR(-EBADF); 5447 return ERR_PTR(-EBADF);
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 301079d06f24..3b106554b42e 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3682,7 +3682,7 @@ unlock:
3682 3682
3683static int perf_fasync(int fd, struct file *filp, int on) 3683static int perf_fasync(int fd, struct file *filp, int on)
3684{ 3684{
3685 struct inode *inode = filp->f_path.dentry->d_inode; 3685 struct inode *inode = file_inode(filp);
3686 struct perf_event *event = filp->private_data; 3686 struct perf_event *event = filp->private_data;
3687 int retval; 3687 int retval;
3688 3688
diff --git a/kernel/fork.c b/kernel/fork.c
index c535f33bbb9c..4ff724f81f25 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -413,7 +413,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
413 tmp->vm_next = tmp->vm_prev = NULL; 413 tmp->vm_next = tmp->vm_prev = NULL;
414 file = tmp->vm_file; 414 file = tmp->vm_file;
415 if (file) { 415 if (file) {
416 struct inode *inode = file->f_path.dentry->d_inode; 416 struct inode *inode = file_inode(file);
417 struct address_space *mapping = file->f_mapping; 417 struct address_space *mapping = file->f_mapping;
418 418
419 get_file(file); 419 get_file(file);
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 4bd4faa6323a..397db02209ed 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -76,7 +76,7 @@ static int irq_affinity_list_proc_show(struct seq_file *m, void *v)
76static ssize_t write_irq_affinity(int type, struct file *file, 76static ssize_t write_irq_affinity(int type, struct file *file,
77 const char __user *buffer, size_t count, loff_t *pos) 77 const char __user *buffer, size_t count, loff_t *pos)
78{ 78{
79 unsigned int irq = (int)(long)PDE(file->f_path.dentry->d_inode)->data; 79 unsigned int irq = (int)(long)PDE(file_inode(file))->data;
80 cpumask_var_t new_value; 80 cpumask_var_t new_value;
81 int err; 81 int err;
82 82
diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index 78e2ecb20165..c057104bf05c 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -251,7 +251,7 @@ SYSCALL_DEFINE2(setns, int, fd, int, nstype)
251 return PTR_ERR(file); 251 return PTR_ERR(file);
252 252
253 err = -EINVAL; 253 err = -EINVAL;
254 ei = PROC_I(file->f_dentry->d_inode); 254 ei = PROC_I(file_inode(file));
255 ops = ei->ns_ops; 255 ops = ei->ns_ops;
256 if (nstype && (ops->type != nstype)) 256 if (nstype && (ops->type != nstype))
257 goto out; 257 goto out;
diff --git a/kernel/relay.c b/kernel/relay.c
index e8cd2027abbd..01ab081ac53a 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -1139,7 +1139,7 @@ static ssize_t relay_file_read_subbufs(struct file *filp, loff_t *ppos,
1139 if (!desc->count) 1139 if (!desc->count)
1140 return 0; 1140 return 0;
1141 1141
1142 mutex_lock(&filp->f_path.dentry->d_inode->i_mutex); 1142 mutex_lock(&file_inode(filp)->i_mutex);
1143 do { 1143 do {
1144 if (!relay_file_read_avail(buf, *ppos)) 1144 if (!relay_file_read_avail(buf, *ppos))
1145 break; 1145 break;
@@ -1159,7 +1159,7 @@ static ssize_t relay_file_read_subbufs(struct file *filp, loff_t *ppos,
1159 *ppos = relay_file_read_end_pos(buf, read_start, ret); 1159 *ppos = relay_file_read_end_pos(buf, read_start, ret);
1160 } 1160 }
1161 } while (desc->count && ret); 1161 } while (desc->count && ret);
1162 mutex_unlock(&filp->f_path.dentry->d_inode->i_mutex); 1162 mutex_unlock(&file_inode(filp)->i_mutex);
1163 1163
1164 return desc->written; 1164 return desc->written;
1165} 1165}
diff --git a/kernel/sys.c b/kernel/sys.c
index 265b37690421..e3932ea50ec8 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1792,14 +1792,14 @@ SYSCALL_DEFINE1(umask, int, mask)
1792static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd) 1792static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)
1793{ 1793{
1794 struct fd exe; 1794 struct fd exe;
1795 struct dentry *dentry; 1795 struct inode *inode;
1796 int err; 1796 int err;
1797 1797
1798 exe = fdget(fd); 1798 exe = fdget(fd);
1799 if (!exe.file) 1799 if (!exe.file)
1800 return -EBADF; 1800 return -EBADF;
1801 1801
1802 dentry = exe.file->f_path.dentry; 1802 inode = file_inode(exe.file);
1803 1803
1804 /* 1804 /*
1805 * Because the original mm->exe_file points to executable file, make 1805 * Because the original mm->exe_file points to executable file, make
@@ -1807,11 +1807,11 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)
1807 * overall picture. 1807 * overall picture.
1808 */ 1808 */
1809 err = -EACCES; 1809 err = -EACCES;
1810 if (!S_ISREG(dentry->d_inode->i_mode) || 1810 if (!S_ISREG(inode->i_mode) ||
1811 exe.file->f_path.mnt->mnt_flags & MNT_NOEXEC) 1811 exe.file->f_path.mnt->mnt_flags & MNT_NOEXEC)
1812 goto exit; 1812 goto exit;
1813 1813
1814 err = inode_permission(dentry->d_inode, MAY_EXEC); 1814 err = inode_permission(inode, MAY_EXEC);
1815 if (err) 1815 if (err)
1816 goto exit; 1816 goto exit;
1817 1817
diff --git a/mm/fadvise.c b/mm/fadvise.c
index a47f0f50c89f..6deaa6c04636 100644
--- a/mm/fadvise.c
+++ b/mm/fadvise.c
@@ -38,7 +38,7 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
38 if (!f.file) 38 if (!f.file)
39 return -EBADF; 39 return -EBADF;
40 40
41 if (S_ISFIFO(f.file->f_path.dentry->d_inode->i_mode)) { 41 if (S_ISFIFO(file_inode(f.file)->i_mode)) {
42 ret = -ESPIPE; 42 ret = -ESPIPE;
43 goto out; 43 goto out;
44 } 44 }
diff --git a/mm/filemap.c b/mm/filemap.c
index 83efee76a5c0..6a48a7ea8f4f 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1711,7 +1711,7 @@ EXPORT_SYMBOL(filemap_fault);
1711int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 1711int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
1712{ 1712{
1713 struct page *page = vmf->page; 1713 struct page *page = vmf->page;
1714 struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 1714 struct inode *inode = file_inode(vma->vm_file);
1715 int ret = VM_FAULT_LOCKED; 1715 int ret = VM_FAULT_LOCKED;
1716 1716
1717 sb_start_pagefault(inode->i_sb); 1717 sb_start_pagefault(inode->i_sb);
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 4f3ea0b1e57c..b97e806e5d9a 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -127,7 +127,7 @@ static inline struct hugepage_subpool *subpool_inode(struct inode *inode)
127 127
128static inline struct hugepage_subpool *subpool_vma(struct vm_area_struct *vma) 128static inline struct hugepage_subpool *subpool_vma(struct vm_area_struct *vma)
129{ 129{
130 return subpool_inode(vma->vm_file->f_dentry->d_inode); 130 return subpool_inode(file_inode(vma->vm_file));
131} 131}
132 132
133/* 133/*
@@ -2482,7 +2482,7 @@ static int unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma,
2482 address = address & huge_page_mask(h); 2482 address = address & huge_page_mask(h);
2483 pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) + 2483 pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) +
2484 vma->vm_pgoff; 2484 vma->vm_pgoff;
2485 mapping = vma->vm_file->f_dentry->d_inode->i_mapping; 2485 mapping = file_inode(vma->vm_file)->i_mapping;
2486 2486
2487 /* 2487 /*
2488 * Take the mapping lock for the duration of the table walk. As 2488 * Take the mapping lock for the duration of the table walk. As
diff --git a/mm/mmap.c b/mm/mmap.c
index 35730ee9d515..22dfc01e9681 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -202,7 +202,7 @@ static void __remove_shared_vm_struct(struct vm_area_struct *vma,
202 struct file *file, struct address_space *mapping) 202 struct file *file, struct address_space *mapping)
203{ 203{
204 if (vma->vm_flags & VM_DENYWRITE) 204 if (vma->vm_flags & VM_DENYWRITE)
205 atomic_inc(&file->f_path.dentry->d_inode->i_writecount); 205 atomic_inc(&file_inode(file)->i_writecount);
206 if (vma->vm_flags & VM_SHARED) 206 if (vma->vm_flags & VM_SHARED)
207 mapping->i_mmap_writable--; 207 mapping->i_mmap_writable--;
208 208
@@ -567,7 +567,7 @@ static void __vma_link_file(struct vm_area_struct *vma)
567 struct address_space *mapping = file->f_mapping; 567 struct address_space *mapping = file->f_mapping;
568 568
569 if (vma->vm_flags & VM_DENYWRITE) 569 if (vma->vm_flags & VM_DENYWRITE)
570 atomic_dec(&file->f_path.dentry->d_inode->i_writecount); 570 atomic_dec(&file_inode(file)->i_writecount);
571 if (vma->vm_flags & VM_SHARED) 571 if (vma->vm_flags & VM_SHARED)
572 mapping->i_mmap_writable++; 572 mapping->i_mmap_writable++;
573 573
@@ -1217,7 +1217,7 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
1217 return -EAGAIN; 1217 return -EAGAIN;
1218 } 1218 }
1219 1219
1220 inode = file ? file->f_path.dentry->d_inode : NULL; 1220 inode = file ? file_inode(file) : NULL;
1221 1221
1222 if (file) { 1222 if (file) {
1223 switch (flags & MAP_TYPE) { 1223 switch (flags & MAP_TYPE) {
@@ -1403,7 +1403,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
1403 int error; 1403 int error;
1404 struct rb_node **rb_link, *rb_parent; 1404 struct rb_node **rb_link, *rb_parent;
1405 unsigned long charged = 0; 1405 unsigned long charged = 0;
1406 struct inode *inode = file ? file->f_path.dentry->d_inode : NULL; 1406 struct inode *inode = file ? file_inode(file) : NULL;
1407 1407
1408 /* Clear old maps */ 1408 /* Clear old maps */
1409 error = -ENOMEM; 1409 error = -ENOMEM;
diff --git a/mm/nommu.c b/mm/nommu.c
index 79c3cac87afa..f87d2173d0d0 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -941,7 +941,7 @@ static int validate_mmap_request(struct file *file,
941 */ 941 */
942 mapping = file->f_mapping; 942 mapping = file->f_mapping;
943 if (!mapping) 943 if (!mapping)
944 mapping = file->f_path.dentry->d_inode->i_mapping; 944 mapping = file_inode(file)->i_mapping;
945 945
946 capabilities = 0; 946 capabilities = 0;
947 if (mapping && mapping->backing_dev_info) 947 if (mapping && mapping->backing_dev_info)
@@ -950,7 +950,7 @@ static int validate_mmap_request(struct file *file,
950 if (!capabilities) { 950 if (!capabilities) {
951 /* no explicit capabilities set, so assume some 951 /* no explicit capabilities set, so assume some
952 * defaults */ 952 * defaults */
953 switch (file->f_path.dentry->d_inode->i_mode & S_IFMT) { 953 switch (file_inode(file)->i_mode & S_IFMT) {
954 case S_IFREG: 954 case S_IFREG:
955 case S_IFBLK: 955 case S_IFBLK:
956 capabilities = BDI_CAP_MAP_COPY; 956 capabilities = BDI_CAP_MAP_COPY;
@@ -985,11 +985,11 @@ static int validate_mmap_request(struct file *file,
985 !(file->f_mode & FMODE_WRITE)) 985 !(file->f_mode & FMODE_WRITE))
986 return -EACCES; 986 return -EACCES;
987 987
988 if (IS_APPEND(file->f_path.dentry->d_inode) && 988 if (IS_APPEND(file_inode(file)) &&
989 (file->f_mode & FMODE_WRITE)) 989 (file->f_mode & FMODE_WRITE))
990 return -EACCES; 990 return -EACCES;
991 991
992 if (locks_verify_locked(file->f_path.dentry->d_inode)) 992 if (locks_verify_locked(file_inode(file)))
993 return -EAGAIN; 993 return -EAGAIN;
994 994
995 if (!(capabilities & BDI_CAP_MAP_DIRECT)) 995 if (!(capabilities & BDI_CAP_MAP_DIRECT))
@@ -1322,8 +1322,8 @@ unsigned long do_mmap_pgoff(struct file *file,
1322 continue; 1322 continue;
1323 1323
1324 /* search for overlapping mappings on the same file */ 1324 /* search for overlapping mappings on the same file */
1325 if (pregion->vm_file->f_path.dentry->d_inode != 1325 if (file_inode(pregion->vm_file) !=
1326 file->f_path.dentry->d_inode) 1326 file_inode(file))
1327 continue; 1327 continue;
1328 1328
1329 if (pregion->vm_pgoff >= pgend) 1329 if (pregion->vm_pgoff >= pgend)
diff --git a/mm/shmem.c b/mm/shmem.c
index 5dd56f6efdbd..814d5546cb35 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1295,7 +1295,7 @@ unlock:
1295 1295
1296static int shmem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) 1296static int shmem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
1297{ 1297{
1298 struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 1298 struct inode *inode = file_inode(vma->vm_file);
1299 int error; 1299 int error;
1300 int ret = VM_FAULT_LOCKED; 1300 int ret = VM_FAULT_LOCKED;
1301 1301
@@ -1313,14 +1313,14 @@ static int shmem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
1313#ifdef CONFIG_NUMA 1313#ifdef CONFIG_NUMA
1314static int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *mpol) 1314static int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *mpol)
1315{ 1315{
1316 struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 1316 struct inode *inode = file_inode(vma->vm_file);
1317 return mpol_set_shared_policy(&SHMEM_I(inode)->policy, vma, mpol); 1317 return mpol_set_shared_policy(&SHMEM_I(inode)->policy, vma, mpol);
1318} 1318}
1319 1319
1320static struct mempolicy *shmem_get_policy(struct vm_area_struct *vma, 1320static struct mempolicy *shmem_get_policy(struct vm_area_struct *vma,
1321 unsigned long addr) 1321 unsigned long addr)
1322{ 1322{
1323 struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 1323 struct inode *inode = file_inode(vma->vm_file);
1324 pgoff_t index; 1324 pgoff_t index;
1325 1325
1326 index = ((addr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; 1326 index = ((addr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
@@ -1330,7 +1330,7 @@ static struct mempolicy *shmem_get_policy(struct vm_area_struct *vma,
1330 1330
1331int shmem_lock(struct file *file, int lock, struct user_struct *user) 1331int shmem_lock(struct file *file, int lock, struct user_struct *user)
1332{ 1332{
1333 struct inode *inode = file->f_path.dentry->d_inode; 1333 struct inode *inode = file_inode(file);
1334 struct shmem_inode_info *info = SHMEM_I(inode); 1334 struct shmem_inode_info *info = SHMEM_I(inode);
1335 int retval = -ENOMEM; 1335 int retval = -ENOMEM;
1336 1336
@@ -1465,7 +1465,7 @@ shmem_write_end(struct file *file, struct address_space *mapping,
1465 1465
1466static void do_shmem_file_read(struct file *filp, loff_t *ppos, read_descriptor_t *desc, read_actor_t actor) 1466static void do_shmem_file_read(struct file *filp, loff_t *ppos, read_descriptor_t *desc, read_actor_t actor)
1467{ 1467{
1468 struct inode *inode = filp->f_path.dentry->d_inode; 1468 struct inode *inode = file_inode(filp);
1469 struct address_space *mapping = inode->i_mapping; 1469 struct address_space *mapping = inode->i_mapping;
1470 pgoff_t index; 1470 pgoff_t index;
1471 unsigned long offset; 1471 unsigned long offset;
@@ -1808,7 +1808,7 @@ static loff_t shmem_file_llseek(struct file *file, loff_t offset, int whence)
1808static long shmem_fallocate(struct file *file, int mode, loff_t offset, 1808static long shmem_fallocate(struct file *file, int mode, loff_t offset,
1809 loff_t len) 1809 loff_t len)
1810{ 1810{
1811 struct inode *inode = file->f_path.dentry->d_inode; 1811 struct inode *inode = file_inode(file);
1812 struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb); 1812 struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb);
1813 struct shmem_falloc shmem_falloc; 1813 struct shmem_falloc shmem_falloc;
1814 pgoff_t start, index, end; 1814 pgoff_t start, index, end;
diff --git a/mm/swapfile.c b/mm/swapfile.c
index e97a0e5aea91..ed393002fc09 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1699,7 +1699,7 @@ static int swap_show(struct seq_file *swap, void *v)
1699 len = seq_path(swap, &file->f_path, " \t\n\\"); 1699 len = seq_path(swap, &file->f_path, " \t\n\\");
1700 seq_printf(swap, "%*s%s\t%u\t%u\t%d\n", 1700 seq_printf(swap, "%*s%s\t%u\t%u\t%d\n",
1701 len < 40 ? 40 - len : 1, " ", 1701 len < 40 ? 40 - len : 1, " ",
1702 S_ISBLK(file->f_path.dentry->d_inode->i_mode) ? 1702 S_ISBLK(file_inode(file)->i_mode) ?
1703 "partition" : "file\t", 1703 "partition" : "file\t",
1704 si->pages << (PAGE_SHIFT - 10), 1704 si->pages << (PAGE_SHIFT - 10),
1705 si->inuse_pages << (PAGE_SHIFT - 10), 1705 si->inuse_pages << (PAGE_SHIFT - 10),
diff --git a/net/atm/proc.c b/net/atm/proc.c
index 0d020de8d233..2518b5f8bb8a 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -385,7 +385,7 @@ static ssize_t proc_dev_atm_read(struct file *file, char __user *buf,
385 page = get_zeroed_page(GFP_KERNEL); 385 page = get_zeroed_page(GFP_KERNEL);
386 if (!page) 386 if (!page)
387 return -ENOMEM; 387 return -ENOMEM;
388 dev = PDE(file->f_path.dentry->d_inode)->data; 388 dev = PDE(file_inode(file))->data;
389 if (!dev->ops->proc_read) 389 if (!dev->ops->proc_read)
390 length = -EINVAL; 390 length = -EINVAL;
391 else { 391 else {
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 8acce01b6dab..80e271d9e64b 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -344,7 +344,7 @@ struct net *get_net_ns_by_fd(int fd)
344 if (IS_ERR(file)) 344 if (IS_ERR(file))
345 return ERR_CAST(file); 345 return ERR_CAST(file);
346 346
347 ei = PROC_I(file->f_dentry->d_inode); 347 ei = PROC_I(file_inode(file));
348 if (ei->ns_ops == &netns_operations) 348 if (ei->ns_ops == &netns_operations)
349 net = get_net(ei->ns); 349 net = get_net(ei->ns);
350 else 350 else
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index 75e33a7048f8..5852b249054f 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -657,7 +657,7 @@ static int clusterip_proc_release(struct inode *inode, struct file *file)
657static ssize_t clusterip_proc_write(struct file *file, const char __user *input, 657static ssize_t clusterip_proc_write(struct file *file, const char __user *input,
658 size_t size, loff_t *ofs) 658 size_t size, loff_t *ofs)
659{ 659{
660 struct clusterip_config *c = PDE(file->f_path.dentry->d_inode)->data; 660 struct clusterip_config *c = PDE(file_inode(file))->data;
661#define PROC_WRITELEN 10 661#define PROC_WRITELEN 10
662 char buffer[PROC_WRITELEN+1]; 662 char buffer[PROC_WRITELEN+1];
663 unsigned long nodenum; 663 unsigned long nodenum;
diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c
index 978efc9b555a..c3cdcb47c149 100644
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -540,7 +540,7 @@ static ssize_t
540recent_mt_proc_write(struct file *file, const char __user *input, 540recent_mt_proc_write(struct file *file, const char __user *input,
541 size_t size, loff_t *loff) 541 size_t size, loff_t *loff)
542{ 542{
543 const struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 543 const struct proc_dir_entry *pde = PDE(file_inode(file));
544 struct recent_table *t = pde->data; 544 struct recent_table *t = pde->data;
545 struct recent_entry *e; 545 struct recent_entry *e;
546 char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")]; 546 char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")];
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index c0353d55d56f..c1ee3a8cf111 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -809,7 +809,7 @@ static struct sock *netlink_getsockbyportid(struct sock *ssk, u32 portid)
809 809
810struct sock *netlink_getsockbyfilp(struct file *filp) 810struct sock *netlink_getsockbyfilp(struct file *filp)
811{ 811{
812 struct inode *inode = filp->f_path.dentry->d_inode; 812 struct inode *inode = file_inode(filp);
813 struct sock *sock; 813 struct sock *sock;
814 814
815 if (!S_ISSOCK(inode->i_mode)) 815 if (!S_ISSOCK(inode->i_mode))
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 6e5c824b040b..294b4bf7ec6e 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -616,7 +616,7 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
616 const void *p, *end; 616 const void *p, *end;
617 void *buf; 617 void *buf;
618 struct gss_upcall_msg *gss_msg; 618 struct gss_upcall_msg *gss_msg;
619 struct rpc_pipe *pipe = RPC_I(filp->f_dentry->d_inode)->pipe; 619 struct rpc_pipe *pipe = RPC_I(file_inode(filp))->pipe;
620 struct gss_cl_ctx *ctx; 620 struct gss_cl_ctx *ctx;
621 uid_t uid; 621 uid_t uid;
622 ssize_t err = -EFBIG; 622 ssize_t err = -EFBIG;
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 9afa4393c217..f3897d10f649 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -755,7 +755,7 @@ static ssize_t cache_read(struct file *filp, char __user *buf, size_t count,
755{ 755{
756 struct cache_reader *rp = filp->private_data; 756 struct cache_reader *rp = filp->private_data;
757 struct cache_request *rq; 757 struct cache_request *rq;
758 struct inode *inode = filp->f_path.dentry->d_inode; 758 struct inode *inode = file_inode(filp);
759 int err; 759 int err;
760 760
761 if (count == 0) 761 if (count == 0)
@@ -886,7 +886,7 @@ static ssize_t cache_write(struct file *filp, const char __user *buf,
886 struct cache_detail *cd) 886 struct cache_detail *cd)
887{ 887{
888 struct address_space *mapping = filp->f_mapping; 888 struct address_space *mapping = filp->f_mapping;
889 struct inode *inode = filp->f_path.dentry->d_inode; 889 struct inode *inode = file_inode(filp);
890 ssize_t ret = -EINVAL; 890 ssize_t ret = -EINVAL;
891 891
892 if (!cd->cache_parse) 892 if (!cd->cache_parse)
@@ -1454,7 +1454,7 @@ static ssize_t write_flush(struct file *file, const char __user *buf,
1454static ssize_t cache_read_procfs(struct file *filp, char __user *buf, 1454static ssize_t cache_read_procfs(struct file *filp, char __user *buf,
1455 size_t count, loff_t *ppos) 1455 size_t count, loff_t *ppos)
1456{ 1456{
1457 struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1457 struct cache_detail *cd = PDE(file_inode(filp))->data;
1458 1458
1459 return cache_read(filp, buf, count, ppos, cd); 1459 return cache_read(filp, buf, count, ppos, cd);
1460} 1460}
@@ -1462,14 +1462,14 @@ static ssize_t cache_read_procfs(struct file *filp, char __user *buf,
1462static ssize_t cache_write_procfs(struct file *filp, const char __user *buf, 1462static ssize_t cache_write_procfs(struct file *filp, const char __user *buf,
1463 size_t count, loff_t *ppos) 1463 size_t count, loff_t *ppos)
1464{ 1464{
1465 struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1465 struct cache_detail *cd = PDE(file_inode(filp))->data;
1466 1466
1467 return cache_write(filp, buf, count, ppos, cd); 1467 return cache_write(filp, buf, count, ppos, cd);
1468} 1468}
1469 1469
1470static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait) 1470static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait)
1471{ 1471{
1472 struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1472 struct cache_detail *cd = PDE(file_inode(filp))->data;
1473 1473
1474 return cache_poll(filp, wait, cd); 1474 return cache_poll(filp, wait, cd);
1475} 1475}
@@ -1477,7 +1477,7 @@ static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait)
1477static long cache_ioctl_procfs(struct file *filp, 1477static long cache_ioctl_procfs(struct file *filp,
1478 unsigned int cmd, unsigned long arg) 1478 unsigned int cmd, unsigned long arg)
1479{ 1479{
1480 struct inode *inode = filp->f_path.dentry->d_inode; 1480 struct inode *inode = file_inode(filp);
1481 struct cache_detail *cd = PDE(inode)->data; 1481 struct cache_detail *cd = PDE(inode)->data;
1482 1482
1483 return cache_ioctl(inode, filp, cmd, arg, cd); 1483 return cache_ioctl(inode, filp, cmd, arg, cd);
@@ -1546,7 +1546,7 @@ static int release_flush_procfs(struct inode *inode, struct file *filp)
1546static ssize_t read_flush_procfs(struct file *filp, char __user *buf, 1546static ssize_t read_flush_procfs(struct file *filp, char __user *buf,
1547 size_t count, loff_t *ppos) 1547 size_t count, loff_t *ppos)
1548{ 1548{
1549 struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1549 struct cache_detail *cd = PDE(file_inode(filp))->data;
1550 1550
1551 return read_flush(filp, buf, count, ppos, cd); 1551 return read_flush(filp, buf, count, ppos, cd);
1552} 1552}
@@ -1555,7 +1555,7 @@ static ssize_t write_flush_procfs(struct file *filp,
1555 const char __user *buf, 1555 const char __user *buf,
1556 size_t count, loff_t *ppos) 1556 size_t count, loff_t *ppos)
1557{ 1557{
1558 struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1558 struct cache_detail *cd = PDE(file_inode(filp))->data;
1559 1559
1560 return write_flush(filp, buf, count, ppos, cd); 1560 return write_flush(filp, buf, count, ppos, cd);
1561} 1561}
@@ -1686,7 +1686,7 @@ EXPORT_SYMBOL_GPL(cache_destroy_net);
1686static ssize_t cache_read_pipefs(struct file *filp, char __user *buf, 1686static ssize_t cache_read_pipefs(struct file *filp, char __user *buf,
1687 size_t count, loff_t *ppos) 1687 size_t count, loff_t *ppos)
1688{ 1688{
1689 struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1689 struct cache_detail *cd = RPC_I(file_inode(filp))->private;
1690 1690
1691 return cache_read(filp, buf, count, ppos, cd); 1691 return cache_read(filp, buf, count, ppos, cd);
1692} 1692}
@@ -1694,14 +1694,14 @@ static ssize_t cache_read_pipefs(struct file *filp, char __user *buf,
1694static ssize_t cache_write_pipefs(struct file *filp, const char __user *buf, 1694static ssize_t cache_write_pipefs(struct file *filp, const char __user *buf,
1695 size_t count, loff_t *ppos) 1695 size_t count, loff_t *ppos)
1696{ 1696{
1697 struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1697 struct cache_detail *cd = RPC_I(file_inode(filp))->private;
1698 1698
1699 return cache_write(filp, buf, count, ppos, cd); 1699 return cache_write(filp, buf, count, ppos, cd);
1700} 1700}
1701 1701
1702static unsigned int cache_poll_pipefs(struct file *filp, poll_table *wait) 1702static unsigned int cache_poll_pipefs(struct file *filp, poll_table *wait)
1703{ 1703{
1704 struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1704 struct cache_detail *cd = RPC_I(file_inode(filp))->private;
1705 1705
1706 return cache_poll(filp, wait, cd); 1706 return cache_poll(filp, wait, cd);
1707} 1707}
@@ -1709,7 +1709,7 @@ static unsigned int cache_poll_pipefs(struct file *filp, poll_table *wait)
1709static long cache_ioctl_pipefs(struct file *filp, 1709static long cache_ioctl_pipefs(struct file *filp,
1710 unsigned int cmd, unsigned long arg) 1710 unsigned int cmd, unsigned long arg)
1711{ 1711{
1712 struct inode *inode = filp->f_dentry->d_inode; 1712 struct inode *inode = file_inode(filp);
1713 struct cache_detail *cd = RPC_I(inode)->private; 1713 struct cache_detail *cd = RPC_I(inode)->private;
1714 1714
1715 return cache_ioctl(inode, filp, cmd, arg, cd); 1715 return cache_ioctl(inode, filp, cmd, arg, cd);
@@ -1778,7 +1778,7 @@ static int release_flush_pipefs(struct inode *inode, struct file *filp)
1778static ssize_t read_flush_pipefs(struct file *filp, char __user *buf, 1778static ssize_t read_flush_pipefs(struct file *filp, char __user *buf,
1779 size_t count, loff_t *ppos) 1779 size_t count, loff_t *ppos)
1780{ 1780{
1781 struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1781 struct cache_detail *cd = RPC_I(file_inode(filp))->private;
1782 1782
1783 return read_flush(filp, buf, count, ppos, cd); 1783 return read_flush(filp, buf, count, ppos, cd);
1784} 1784}
@@ -1787,7 +1787,7 @@ static ssize_t write_flush_pipefs(struct file *filp,
1787 const char __user *buf, 1787 const char __user *buf,
1788 size_t count, loff_t *ppos) 1788 size_t count, loff_t *ppos)
1789{ 1789{
1790 struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1790 struct cache_detail *cd = RPC_I(file_inode(filp))->private;
1791 1791
1792 return write_flush(filp, buf, count, ppos, cd); 1792 return write_flush(filp, buf, count, ppos, cd);
1793} 1793}
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index fd10981ea792..7b9b40224a27 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -284,7 +284,7 @@ out:
284static ssize_t 284static ssize_t
285rpc_pipe_read(struct file *filp, char __user *buf, size_t len, loff_t *offset) 285rpc_pipe_read(struct file *filp, char __user *buf, size_t len, loff_t *offset)
286{ 286{
287 struct inode *inode = filp->f_path.dentry->d_inode; 287 struct inode *inode = file_inode(filp);
288 struct rpc_pipe *pipe; 288 struct rpc_pipe *pipe;
289 struct rpc_pipe_msg *msg; 289 struct rpc_pipe_msg *msg;
290 int res = 0; 290 int res = 0;
@@ -328,7 +328,7 @@ out_unlock:
328static ssize_t 328static ssize_t
329rpc_pipe_write(struct file *filp, const char __user *buf, size_t len, loff_t *offset) 329rpc_pipe_write(struct file *filp, const char __user *buf, size_t len, loff_t *offset)
330{ 330{
331 struct inode *inode = filp->f_path.dentry->d_inode; 331 struct inode *inode = file_inode(filp);
332 int res; 332 int res;
333 333
334 mutex_lock(&inode->i_mutex); 334 mutex_lock(&inode->i_mutex);
@@ -342,7 +342,7 @@ rpc_pipe_write(struct file *filp, const char __user *buf, size_t len, loff_t *of
342static unsigned int 342static unsigned int
343rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait) 343rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait)
344{ 344{
345 struct inode *inode = filp->f_path.dentry->d_inode; 345 struct inode *inode = file_inode(filp);
346 struct rpc_inode *rpci = RPC_I(inode); 346 struct rpc_inode *rpci = RPC_I(inode);
347 unsigned int mask = POLLOUT | POLLWRNORM; 347 unsigned int mask = POLLOUT | POLLWRNORM;
348 348
@@ -360,7 +360,7 @@ rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait)
360static long 360static long
361rpc_pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 361rpc_pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
362{ 362{
363 struct inode *inode = filp->f_path.dentry->d_inode; 363 struct inode *inode = file_inode(filp);
364 struct rpc_pipe *pipe; 364 struct rpc_pipe *pipe;
365 int len; 365 int len;
366 366
@@ -830,7 +830,7 @@ static int rpc_rmdir_depopulate(struct dentry *dentry,
830 * responses to upcalls. They will result in calls to @msg->downcall. 830 * responses to upcalls. They will result in calls to @msg->downcall.
831 * 831 *
832 * The @private argument passed here will be available to all these methods 832 * The @private argument passed here will be available to all these methods
833 * from the file pointer, via RPC_I(file->f_dentry->d_inode)->private. 833 * from the file pointer, via RPC_I(file_inode(file))->private.
834 */ 834 */
835struct dentry *rpc_mkpipe_dentry(struct dentry *parent, const char *name, 835struct dentry *rpc_mkpipe_dentry(struct dentry *parent, const char *name,
836 void *private, struct rpc_pipe *pipe) 836 void *private, struct rpc_pipe *pipe)
diff --git a/net/unix/garbage.c b/net/unix/garbage.c
index b6f4b994eb35..d0f6545b0010 100644
--- a/net/unix/garbage.c
+++ b/net/unix/garbage.c
@@ -99,7 +99,7 @@ unsigned int unix_tot_inflight;
99struct sock *unix_get_socket(struct file *filp) 99struct sock *unix_get_socket(struct file *filp)
100{ 100{
101 struct sock *u_sock = NULL; 101 struct sock *u_sock = NULL;
102 struct inode *inode = filp->f_path.dentry->d_inode; 102 struct inode *inode = file_inode(filp);
103 103
104 /* 104 /*
105 * Socket ? 105 * Socket ?
diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
index 60f0c76a27d3..859abdaac1ea 100644
--- a/security/apparmor/domain.c
+++ b/security/apparmor/domain.c
@@ -349,8 +349,8 @@ int apparmor_bprm_set_creds(struct linux_binprm *bprm)
349 unsigned int state; 349 unsigned int state;
350 struct file_perms perms = {}; 350 struct file_perms perms = {};
351 struct path_cond cond = { 351 struct path_cond cond = {
352 bprm->file->f_path.dentry->d_inode->i_uid, 352 file_inode(bprm->file)->i_uid,
353 bprm->file->f_path.dentry->d_inode->i_mode 353 file_inode(bprm->file)->i_mode
354 }; 354 };
355 const char *name = NULL, *target = NULL, *info = NULL; 355 const char *name = NULL, *target = NULL, *info = NULL;
356 int error = cap_bprm_set_creds(bprm); 356 int error = cap_bprm_set_creds(bprm);
diff --git a/security/apparmor/file.c b/security/apparmor/file.c
index cd21ec5b90af..fdaa50cb1876 100644
--- a/security/apparmor/file.c
+++ b/security/apparmor/file.c
@@ -449,8 +449,8 @@ int aa_file_perm(int op, struct aa_profile *profile, struct file *file,
449 u32 request) 449 u32 request)
450{ 450{
451 struct path_cond cond = { 451 struct path_cond cond = {
452 .uid = file->f_path.dentry->d_inode->i_uid, 452 .uid = file_inode(file)->i_uid,
453 .mode = file->f_path.dentry->d_inode->i_mode 453 .mode = file_inode(file)->i_mode
454 }; 454 };
455 455
456 return aa_path_perm(op, profile, &file->f_path, PATH_DELEGATE_DELETED, 456 return aa_path_perm(op, profile, &file->f_path, PATH_DELEGATE_DELETED,
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 8c2a7f6b35e2..b21830eced41 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -379,7 +379,7 @@ static int apparmor_file_open(struct file *file, const struct cred *cred)
379 struct aa_profile *profile; 379 struct aa_profile *profile;
380 int error = 0; 380 int error = 0;
381 381
382 if (!mediated_filesystem(file->f_path.dentry->d_inode)) 382 if (!mediated_filesystem(file_inode(file)))
383 return 0; 383 return 0;
384 384
385 /* If in exec, permission is handled by bprm hooks. 385 /* If in exec, permission is handled by bprm hooks.
@@ -394,7 +394,7 @@ static int apparmor_file_open(struct file *file, const struct cred *cred)
394 394
395 profile = aa_cred_profile(cred); 395 profile = aa_cred_profile(cred);
396 if (!unconfined(profile)) { 396 if (!unconfined(profile)) {
397 struct inode *inode = file->f_path.dentry->d_inode; 397 struct inode *inode = file_inode(file);
398 struct path_cond cond = { inode->i_uid, inode->i_mode }; 398 struct path_cond cond = { inode->i_uid, inode->i_mode };
399 399
400 error = aa_path_perm(OP_OPEN, profile, &file->f_path, 0, 400 error = aa_path_perm(OP_OPEN, profile, &file->f_path, 0,
@@ -432,7 +432,7 @@ static int common_file_perm(int op, struct file *file, u32 mask)
432 BUG_ON(!fprofile); 432 BUG_ON(!fprofile);
433 433
434 if (!file->f_path.mnt || 434 if (!file->f_path.mnt ||
435 !mediated_filesystem(file->f_path.dentry->d_inode)) 435 !mediated_filesystem(file_inode(file)))
436 return 0; 436 return 0;
437 437
438 profile = __aa_current_profile(); 438 profile = __aa_current_profile();
diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c
index 0cea3db21657..27cb9eb42cc8 100644
--- a/security/integrity/ima/ima_api.c
+++ b/security/integrity/ima/ima_api.c
@@ -140,12 +140,12 @@ int ima_must_measure(struct inode *inode, int mask, int function)
140int ima_collect_measurement(struct integrity_iint_cache *iint, 140int ima_collect_measurement(struct integrity_iint_cache *iint,
141 struct file *file) 141 struct file *file)
142{ 142{
143 struct inode *inode = file->f_dentry->d_inode; 143 struct inode *inode = file_inode(file);
144 const char *filename = file->f_dentry->d_name.name; 144 const char *filename = file->f_dentry->d_name.name;
145 int result = 0; 145 int result = 0;
146 146
147 if (!(iint->flags & IMA_COLLECTED)) { 147 if (!(iint->flags & IMA_COLLECTED)) {
148 u64 i_version = file->f_dentry->d_inode->i_version; 148 u64 i_version = file_inode(file)->i_version;
149 149
150 iint->ima_xattr.type = IMA_XATTR_DIGEST; 150 iint->ima_xattr.type = IMA_XATTR_DIGEST;
151 result = ima_calc_hash(file, iint->ima_xattr.digest); 151 result = ima_calc_hash(file, iint->ima_xattr.digest);
@@ -182,7 +182,7 @@ void ima_store_measurement(struct integrity_iint_cache *iint,
182 const char *op = "add_template_measure"; 182 const char *op = "add_template_measure";
183 const char *audit_cause = "ENOMEM"; 183 const char *audit_cause = "ENOMEM";
184 int result = -ENOMEM; 184 int result = -ENOMEM;
185 struct inode *inode = file->f_dentry->d_inode; 185 struct inode *inode = file_inode(file);
186 struct ima_template_entry *entry; 186 struct ima_template_entry *entry;
187 int violation = 0; 187 int violation = 0;
188 188
diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c
index b21ee5b5495a..81dcaa26401e 100644
--- a/security/integrity/ima/ima_crypto.c
+++ b/security/integrity/ima/ima_crypto.c
@@ -63,7 +63,7 @@ int ima_calc_hash(struct file *file, char *digest)
63 file->f_mode |= FMODE_READ; 63 file->f_mode |= FMODE_READ;
64 read = 1; 64 read = 1;
65 } 65 }
66 i_size = i_size_read(file->f_dentry->d_inode); 66 i_size = i_size_read(file_inode(file));
67 while (offset < i_size) { 67 while (offset < i_size) {
68 int rbuf_len; 68 int rbuf_len;
69 69
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
index dba965de90d3..e7a147f7d371 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -132,7 +132,7 @@ static void ima_check_last_writer(struct integrity_iint_cache *iint,
132 */ 132 */
133void ima_file_free(struct file *file) 133void ima_file_free(struct file *file)
134{ 134{
135 struct inode *inode = file->f_dentry->d_inode; 135 struct inode *inode = file_inode(file);
136 struct integrity_iint_cache *iint; 136 struct integrity_iint_cache *iint;
137 137
138 if (!iint_initialized || !S_ISREG(inode->i_mode)) 138 if (!iint_initialized || !S_ISREG(inode->i_mode))
@@ -148,7 +148,7 @@ void ima_file_free(struct file *file)
148static int process_measurement(struct file *file, const unsigned char *filename, 148static int process_measurement(struct file *file, const unsigned char *filename,
149 int mask, int function) 149 int mask, int function)
150{ 150{
151 struct inode *inode = file->f_dentry->d_inode; 151 struct inode *inode = file_inode(file);
152 struct integrity_iint_cache *iint; 152 struct integrity_iint_cache *iint;
153 unsigned char *pathname = NULL, *pathbuf = NULL; 153 unsigned char *pathname = NULL, *pathbuf = NULL;
154 int rc = -ENOMEM, action, must_appraise; 154 int rc = -ENOMEM, action, must_appraise;
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 61a53367d029..2963c689f9c0 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1528,7 +1528,7 @@ static int file_has_perm(const struct cred *cred,
1528 u32 av) 1528 u32 av)
1529{ 1529{
1530 struct file_security_struct *fsec = file->f_security; 1530 struct file_security_struct *fsec = file->f_security;
1531 struct inode *inode = file->f_path.dentry->d_inode; 1531 struct inode *inode = file_inode(file);
1532 struct common_audit_data ad; 1532 struct common_audit_data ad;
1533 u32 sid = cred_sid(cred); 1533 u32 sid = cred_sid(cred);
1534 int rc; 1534 int rc;
@@ -1957,7 +1957,7 @@ static int selinux_bprm_set_creds(struct linux_binprm *bprm)
1957 struct task_security_struct *new_tsec; 1957 struct task_security_struct *new_tsec;
1958 struct inode_security_struct *isec; 1958 struct inode_security_struct *isec;
1959 struct common_audit_data ad; 1959 struct common_audit_data ad;
1960 struct inode *inode = bprm->file->f_path.dentry->d_inode; 1960 struct inode *inode = file_inode(bprm->file);
1961 int rc; 1961 int rc;
1962 1962
1963 rc = cap_bprm_set_creds(bprm); 1963 rc = cap_bprm_set_creds(bprm);
@@ -2929,7 +2929,7 @@ static void selinux_inode_getsecid(const struct inode *inode, u32 *secid)
2929static int selinux_revalidate_file_permission(struct file *file, int mask) 2929static int selinux_revalidate_file_permission(struct file *file, int mask)
2930{ 2930{
2931 const struct cred *cred = current_cred(); 2931 const struct cred *cred = current_cred();
2932 struct inode *inode = file->f_path.dentry->d_inode; 2932 struct inode *inode = file_inode(file);
2933 2933
2934 /* file_mask_to_av won't add FILE__WRITE if MAY_APPEND is set */ 2934 /* file_mask_to_av won't add FILE__WRITE if MAY_APPEND is set */
2935 if ((file->f_flags & O_APPEND) && (mask & MAY_WRITE)) 2935 if ((file->f_flags & O_APPEND) && (mask & MAY_WRITE))
@@ -2941,7 +2941,7 @@ static int selinux_revalidate_file_permission(struct file *file, int mask)
2941 2941
2942static int selinux_file_permission(struct file *file, int mask) 2942static int selinux_file_permission(struct file *file, int mask)
2943{ 2943{
2944 struct inode *inode = file->f_path.dentry->d_inode; 2944 struct inode *inode = file_inode(file);
2945 struct file_security_struct *fsec = file->f_security; 2945 struct file_security_struct *fsec = file->f_security;
2946 struct inode_security_struct *isec = inode->i_security; 2946 struct inode_security_struct *isec = inode->i_security;
2947 u32 sid = current_sid(); 2947 u32 sid = current_sid();
@@ -3218,7 +3218,7 @@ static int selinux_file_open(struct file *file, const struct cred *cred)
3218 struct inode_security_struct *isec; 3218 struct inode_security_struct *isec;
3219 3219
3220 fsec = file->f_security; 3220 fsec = file->f_security;
3221 isec = file->f_path.dentry->d_inode->i_security; 3221 isec = file_inode(file)->i_security;
3222 /* 3222 /*
3223 * Save inode label and policy sequence number 3223 * Save inode label and policy sequence number
3224 * at open-time so that selinux_file_permission 3224 * at open-time so that selinux_file_permission
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index 3a6e8731646c..ff427733c290 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -202,7 +202,7 @@ static ssize_t sel_read_handle_unknown(struct file *filp, char __user *buf,
202{ 202{
203 char tmpbuf[TMPBUFLEN]; 203 char tmpbuf[TMPBUFLEN];
204 ssize_t length; 204 ssize_t length;
205 ino_t ino = filp->f_path.dentry->d_inode->i_ino; 205 ino_t ino = file_inode(filp)->i_ino;
206 int handle_unknown = (ino == SEL_REJECT_UNKNOWN) ? 206 int handle_unknown = (ino == SEL_REJECT_UNKNOWN) ?
207 security_get_reject_unknown() : !security_get_allow_unknown(); 207 security_get_reject_unknown() : !security_get_allow_unknown();
208 208
@@ -671,7 +671,7 @@ static ssize_t (*write_op[])(struct file *, char *, size_t) = {
671 671
672static ssize_t selinux_transaction_write(struct file *file, const char __user *buf, size_t size, loff_t *pos) 672static ssize_t selinux_transaction_write(struct file *file, const char __user *buf, size_t size, loff_t *pos)
673{ 673{
674 ino_t ino = file->f_path.dentry->d_inode->i_ino; 674 ino_t ino = file_inode(file)->i_ino;
675 char *data; 675 char *data;
676 ssize_t rv; 676 ssize_t rv;
677 677
@@ -1042,8 +1042,7 @@ static ssize_t sel_read_bool(struct file *filep, char __user *buf,
1042 ssize_t length; 1042 ssize_t length;
1043 ssize_t ret; 1043 ssize_t ret;
1044 int cur_enforcing; 1044 int cur_enforcing;
1045 struct inode *inode = filep->f_path.dentry->d_inode; 1045 unsigned index = file_inode(filep)->i_ino & SEL_INO_MASK;
1046 unsigned index = inode->i_ino & SEL_INO_MASK;
1047 const char *name = filep->f_path.dentry->d_name.name; 1046 const char *name = filep->f_path.dentry->d_name.name;
1048 1047
1049 mutex_lock(&sel_mutex); 1048 mutex_lock(&sel_mutex);
@@ -1077,8 +1076,7 @@ static ssize_t sel_write_bool(struct file *filep, const char __user *buf,
1077 char *page = NULL; 1076 char *page = NULL;
1078 ssize_t length; 1077 ssize_t length;
1079 int new_value; 1078 int new_value;
1080 struct inode *inode = filep->f_path.dentry->d_inode; 1079 unsigned index = file_inode(filep)->i_ino & SEL_INO_MASK;
1081 unsigned index = inode->i_ino & SEL_INO_MASK;
1082 const char *name = filep->f_path.dentry->d_name.name; 1080 const char *name = filep->f_path.dentry->d_name.name;
1083 1081
1084 mutex_lock(&sel_mutex); 1082 mutex_lock(&sel_mutex);
@@ -1486,13 +1484,11 @@ static int sel_make_avc_files(struct dentry *dir)
1486static ssize_t sel_read_initcon(struct file *file, char __user *buf, 1484static ssize_t sel_read_initcon(struct file *file, char __user *buf,
1487 size_t count, loff_t *ppos) 1485 size_t count, loff_t *ppos)
1488{ 1486{
1489 struct inode *inode;
1490 char *con; 1487 char *con;
1491 u32 sid, len; 1488 u32 sid, len;
1492 ssize_t ret; 1489 ssize_t ret;
1493 1490
1494 inode = file->f_path.dentry->d_inode; 1491 sid = file_inode(file)->i_ino&SEL_INO_MASK;
1495 sid = inode->i_ino&SEL_INO_MASK;
1496 ret = security_sid_to_context(sid, &con, &len); 1492 ret = security_sid_to_context(sid, &con, &len);
1497 if (ret) 1493 if (ret)
1498 return ret; 1494 return ret;
@@ -1553,7 +1549,7 @@ static inline u32 sel_ino_to_perm(unsigned long ino)
1553static ssize_t sel_read_class(struct file *file, char __user *buf, 1549static ssize_t sel_read_class(struct file *file, char __user *buf,
1554 size_t count, loff_t *ppos) 1550 size_t count, loff_t *ppos)
1555{ 1551{
1556 unsigned long ino = file->f_path.dentry->d_inode->i_ino; 1552 unsigned long ino = file_inode(file)->i_ino;
1557 char res[TMPBUFLEN]; 1553 char res[TMPBUFLEN];
1558 ssize_t len = snprintf(res, sizeof(res), "%d", sel_ino_to_class(ino)); 1554 ssize_t len = snprintf(res, sizeof(res), "%d", sel_ino_to_class(ino));
1559 return simple_read_from_buffer(buf, count, ppos, res, len); 1555 return simple_read_from_buffer(buf, count, ppos, res, len);
@@ -1567,7 +1563,7 @@ static const struct file_operations sel_class_ops = {
1567static ssize_t sel_read_perm(struct file *file, char __user *buf, 1563static ssize_t sel_read_perm(struct file *file, char __user *buf,
1568 size_t count, loff_t *ppos) 1564 size_t count, loff_t *ppos)
1569{ 1565{
1570 unsigned long ino = file->f_path.dentry->d_inode->i_ino; 1566 unsigned long ino = file_inode(file)->i_ino;
1571 char res[TMPBUFLEN]; 1567 char res[TMPBUFLEN];
1572 ssize_t len = snprintf(res, sizeof(res), "%d", sel_ino_to_perm(ino)); 1568 ssize_t len = snprintf(res, sizeof(res), "%d", sel_ino_to_perm(ino));
1573 return simple_read_from_buffer(buf, count, ppos, res, len); 1569 return simple_read_from_buffer(buf, count, ppos, res, len);
@@ -1584,7 +1580,7 @@ static ssize_t sel_read_policycap(struct file *file, char __user *buf,
1584 int value; 1580 int value;
1585 char tmpbuf[TMPBUFLEN]; 1581 char tmpbuf[TMPBUFLEN];
1586 ssize_t length; 1582 ssize_t length;
1587 unsigned long i_ino = file->f_path.dentry->d_inode->i_ino; 1583 unsigned long i_ino = file_inode(file)->i_ino;
1588 1584
1589 value = security_policycap_supported(i_ino & SEL_INO_MASK); 1585 value = security_policycap_supported(i_ino & SEL_INO_MASK);
1590 length = scnprintf(tmpbuf, TMPBUFLEN, "%d", value); 1586 length = scnprintf(tmpbuf, TMPBUFLEN, "%d", value);
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 38be92ce901e..fa64740abb59 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -456,7 +456,7 @@ static int smack_sb_umount(struct vfsmount *mnt, int flags)
456 */ 456 */
457static int smack_bprm_set_creds(struct linux_binprm *bprm) 457static int smack_bprm_set_creds(struct linux_binprm *bprm)
458{ 458{
459 struct inode *inode = bprm->file->f_path.dentry->d_inode; 459 struct inode *inode = file_inode(bprm->file);
460 struct task_smack *bsp = bprm->cred->security; 460 struct task_smack *bsp = bprm->cred->security;
461 struct inode_smack *isp; 461 struct inode_smack *isp;
462 int rc; 462 int rc;
@@ -1187,21 +1187,15 @@ static int smack_mmap_file(struct file *file,
1187 char *msmack; 1187 char *msmack;
1188 char *osmack; 1188 char *osmack;
1189 struct inode_smack *isp; 1189 struct inode_smack *isp;
1190 struct dentry *dp;
1191 int may; 1190 int may;
1192 int mmay; 1191 int mmay;
1193 int tmay; 1192 int tmay;
1194 int rc; 1193 int rc;
1195 1194
1196 if (file == NULL || file->f_dentry == NULL) 1195 if (file == NULL)
1197 return 0;
1198
1199 dp = file->f_dentry;
1200
1201 if (dp->d_inode == NULL)
1202 return 0; 1196 return 0;
1203 1197
1204 isp = dp->d_inode->i_security; 1198 isp = file_inode(file)->i_security;
1205 if (isp->smk_mmap == NULL) 1199 if (isp->smk_mmap == NULL)
1206 return 0; 1200 return 0;
1207 msmack = isp->smk_mmap; 1201 msmack = isp->smk_mmap;
@@ -1359,7 +1353,7 @@ static int smack_file_receive(struct file *file)
1359 */ 1353 */
1360static int smack_file_open(struct file *file, const struct cred *cred) 1354static int smack_file_open(struct file *file, const struct cred *cred)
1361{ 1355{
1362 struct inode_smack *isp = file->f_path.dentry->d_inode->i_security; 1356 struct inode_smack *isp = file_inode(file)->i_security;
1363 1357
1364 file->f_security = isp->smk_inode; 1358 file->f_security = isp->smk_inode;
1365 1359
diff --git a/security/tomoyo/securityfs_if.c b/security/tomoyo/securityfs_if.c
index 8592f2fc6ebb..fcf32783b66b 100644
--- a/security/tomoyo/securityfs_if.c
+++ b/security/tomoyo/securityfs_if.c
@@ -135,7 +135,7 @@ static const struct file_operations tomoyo_self_operations = {
135 */ 135 */
136static int tomoyo_open(struct inode *inode, struct file *file) 136static int tomoyo_open(struct inode *inode, struct file *file)
137{ 137{
138 const int key = ((u8 *) file->f_path.dentry->d_inode->i_private) 138 const int key = ((u8 *) file_inode(file)->i_private)
139 - ((u8 *) NULL); 139 - ((u8 *) NULL);
140 return tomoyo_open_control(key, file); 140 return tomoyo_open_control(key, file);
141} 141}
diff --git a/sound/core/info.c b/sound/core/info.c
index 6b368d25073b..5bb97e7d325a 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -496,7 +496,7 @@ static long snd_info_entry_ioctl(struct file *file, unsigned int cmd,
496 496
497static int snd_info_entry_mmap(struct file *file, struct vm_area_struct *vma) 497static int snd_info_entry_mmap(struct file *file, struct vm_area_struct *vma)
498{ 498{
499 struct inode *inode = file->f_path.dentry->d_inode; 499 struct inode *inode = file_inode(file);
500 struct snd_info_private_data *data; 500 struct snd_info_private_data *data;
501 struct snd_info_entry *entry; 501 struct snd_info_entry *entry;
502 502
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 09b4286c65f9..71ae86ca64ac 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1586,7 +1586,7 @@ static struct file *snd_pcm_file_fd(int fd, int *fput_needed)
1586 file = fget_light(fd, fput_needed); 1586 file = fget_light(fd, fput_needed);
1587 if (!file) 1587 if (!file)
1588 return NULL; 1588 return NULL;
1589 inode = file->f_path.dentry->d_inode; 1589 inode = file_inode(file);
1590 if (!S_ISCHR(inode->i_mode) || 1590 if (!S_ISCHR(inode->i_mode) ||
1591 imajor(inode) != snd_major) { 1591 imajor(inode) != snd_major) {
1592 fput_light(file, *fput_needed); 1592 fput_light(file, *fput_needed);
diff --git a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c
index 536c4c0514d3..11ff7c55240c 100644
--- a/sound/oss/msnd_pinnacle.c
+++ b/sound/oss/msnd_pinnacle.c
@@ -642,7 +642,7 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
642 642
643static long dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 643static long dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
644{ 644{
645 int minor = iminor(file->f_path.dentry->d_inode); 645 int minor = iminor(file_inode(file));
646 int ret; 646 int ret;
647 647
648 if (cmd == OSS_GETVERSION) { 648 if (cmd == OSS_GETVERSION) {
@@ -1012,7 +1012,7 @@ static int dsp_write(const char __user *buf, size_t len)
1012 1012
1013static ssize_t dev_read(struct file *file, char __user *buf, size_t count, loff_t *off) 1013static ssize_t dev_read(struct file *file, char __user *buf, size_t count, loff_t *off)
1014{ 1014{
1015 int minor = iminor(file->f_path.dentry->d_inode); 1015 int minor = iminor(file_inode(file));
1016 if (minor == dev.dsp_minor) 1016 if (minor == dev.dsp_minor)
1017 return dsp_read(buf, count); 1017 return dsp_read(buf, count);
1018 else 1018 else
@@ -1021,7 +1021,7 @@ static ssize_t dev_read(struct file *file, char __user *buf, size_t count, loff_
1021 1021
1022static ssize_t dev_write(struct file *file, const char __user *buf, size_t count, loff_t *off) 1022static ssize_t dev_write(struct file *file, const char __user *buf, size_t count, loff_t *off)
1023{ 1023{
1024 int minor = iminor(file->f_path.dentry->d_inode); 1024 int minor = iminor(file_inode(file));
1025 if (minor == dev.dsp_minor) 1025 if (minor == dev.dsp_minor)
1026 return dsp_write(buf, count); 1026 return dsp_write(buf, count);
1027 else 1027 else
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
index 7c7793a0eb25..e7780349cc55 100644
--- a/sound/oss/soundcard.c
+++ b/sound/oss/soundcard.c
@@ -143,7 +143,7 @@ static int get_mixer_levels(void __user * arg)
143 143
144static ssize_t sound_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) 144static ssize_t sound_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
145{ 145{
146 int dev = iminor(file->f_path.dentry->d_inode); 146 int dev = iminor(file_inode(file));
147 int ret = -EINVAL; 147 int ret = -EINVAL;
148 148
149 /* 149 /*
@@ -176,7 +176,7 @@ static ssize_t sound_read(struct file *file, char __user *buf, size_t count, lof
176 176
177static ssize_t sound_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) 177static ssize_t sound_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
178{ 178{
179 int dev = iminor(file->f_path.dentry->d_inode); 179 int dev = iminor(file_inode(file));
180 int ret = -EINVAL; 180 int ret = -EINVAL;
181 181
182 mutex_lock(&soundcard_mutex); 182 mutex_lock(&soundcard_mutex);
@@ -333,7 +333,7 @@ static int sound_mixer_ioctl(int mixdev, unsigned int cmd, void __user *arg)
333static long sound_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 333static long sound_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
334{ 334{
335 int len = 0, dtype; 335 int len = 0, dtype;
336 int dev = iminor(file->f_dentry->d_inode); 336 int dev = iminor(file_inode(file));
337 long ret = -EINVAL; 337 long ret = -EINVAL;
338 void __user *p = (void __user *)arg; 338 void __user *p = (void __user *)arg;
339 339
@@ -406,7 +406,7 @@ static long sound_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
406 406
407static unsigned int sound_poll(struct file *file, poll_table * wait) 407static unsigned int sound_poll(struct file *file, poll_table * wait)
408{ 408{
409 struct inode *inode = file->f_path.dentry->d_inode; 409 struct inode *inode = file_inode(file);
410 int dev = iminor(inode); 410 int dev = iminor(inode);
411 411
412 DEB(printk("sound_poll(dev=%d)\n", dev)); 412 DEB(printk("sound_poll(dev=%d)\n", dev));
@@ -431,7 +431,7 @@ static int sound_mmap(struct file *file, struct vm_area_struct *vma)
431 int dev_class; 431 int dev_class;
432 unsigned long size; 432 unsigned long size;
433 struct dma_buffparms *dmap = NULL; 433 struct dma_buffparms *dmap = NULL;
434 int dev = iminor(file->f_path.dentry->d_inode); 434 int dev = iminor(file_inode(file));
435 435
436 dev_class = dev & 0x0f; 436 dev_class = dev & 0x0f;
437 dev >>= 4; 437 dev >>= 4;
diff --git a/sound/sound_firmware.c b/sound/sound_firmware.c
index 37711a5d0d6b..e14903468051 100644
--- a/sound/sound_firmware.c
+++ b/sound/sound_firmware.c
@@ -19,7 +19,7 @@ static int do_mod_firmware_load(const char *fn, char **fp)
19 printk(KERN_INFO "Unable to load '%s'.\n", fn); 19 printk(KERN_INFO "Unable to load '%s'.\n", fn);
20 return 0; 20 return 0;
21 } 21 }
22 l = i_size_read(filp->f_path.dentry->d_inode); 22 l = i_size_read(file_inode(filp));
23 if (l <= 0 || l > 131072) 23 if (l <= 0 || l > 131072)
24 { 24 {
25 printk(KERN_INFO "Invalid firmware '%s'\n", fn); 25 printk(KERN_INFO "Invalid firmware '%s'\n", fn);