fs: dcache reduce branches in lookup path
authorNick Piggin <npiggin@kernel.dk>
Fri, 7 Jan 2011 06:49:55 +0000 (17:49 +1100)
committerNick Piggin <npiggin@kernel.dk>
Fri, 7 Jan 2011 06:50:28 +0000 (17:50 +1100)
commitfb045adb99d9b7c562dc7fef834857f78249daa1
tree1fd6a4024fffeec568abe100d730589bfdb81c38
parent5f57cbcc02cf18f6b22ef4066bb10afeb8f930ff
fs: dcache reduce branches in lookup path

Reduce some branches and memory accesses in dcache lookup by adding dentry
flags to indicate common d_ops are set, rather than having to check them.
This saves a pointer memory access (dentry->d_op) in common path lookup
situations, and saves another pointer load and branch in cases where we
have d_op but not the particular operation.

Patched with:

git grep -E '[.>]([[:space:]])*d_op([[:space:]])*=' | xargs sed -e 's/\([^\t ]*\)->d_op = \(.*\);/d_set_d_op(\1, \2);/' -e 's/\([^\t ]*\)\.d_op = \(.*\);/d_set_d_op(\&\1, \2);/' -i

Signed-off-by: Nick Piggin <npiggin@kernel.dk>
63 files changed:
arch/ia64/kernel/perfmon.c
drivers/staging/autofs/root.c
drivers/staging/smbfs/dir.c
fs/9p/vfs_inode.c
fs/adfs/dir.c
fs/adfs/super.c
fs/affs/namei.c
fs/affs/super.c
fs/afs/dir.c
fs/anon_inodes.c
fs/autofs4/inode.c
fs/autofs4/root.c
fs/btrfs/export.c
fs/btrfs/inode.c
fs/ceph/dir.c
fs/cifs/dir.c
fs/cifs/inode.c
fs/cifs/link.c
fs/cifs/readdir.c
fs/coda/dir.c
fs/configfs/dir.c
fs/dcache.c
fs/ecryptfs/inode.c
fs/ecryptfs/main.c
fs/fat/inode.c
fs/fat/namei_msdos.c
fs/fat/namei_vfat.c
fs/fuse/dir.c
fs/fuse/inode.c
fs/gfs2/export.c
fs/gfs2/ops_fstype.c
fs/gfs2/ops_inode.c
fs/hfs/dir.c
fs/hfs/super.c
fs/hfsplus/dir.c
fs/hfsplus/super.c
fs/hostfs/hostfs_kern.c
fs/hpfs/dentry.c
fs/isofs/inode.c
fs/isofs/namei.c
fs/jfs/namei.c
fs/jfs/super.c
fs/libfs.c
fs/minix/namei.c
fs/namei.c
fs/ncpfs/dir.c
fs/ncpfs/inode.c
fs/nfs/dir.c
fs/nfs/getroot.c
fs/ocfs2/export.c
fs/ocfs2/namei.c
fs/pipe.c
fs/proc/base.c
fs/proc/generic.c
fs/proc/proc_sysctl.c
fs/reiserfs/xattr.c
fs/sysfs/dir.c
fs/sysv/namei.c
fs/sysv/super.c
include/linux/dcache.h
kernel/cgroup.c
net/socket.c
net/sunrpc/rpc_pipe.c