diff options
author | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:49:55 -0500 |
---|---|---|
committer | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:50:28 -0500 |
commit | fb045adb99d9b7c562dc7fef834857f78249daa1 (patch) | |
tree | 1fd6a4024fffeec568abe100d730589bfdb81c38 /fs/fat/inode.c | |
parent | 5f57cbcc02cf18f6b22ef4066bb10afeb8f930ff (diff) |
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>
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r-- | fs/fat/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 8cccfebee180..206351af7c58 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -750,7 +750,7 @@ static struct dentry *fat_fh_to_dentry(struct super_block *sb, | |||
750 | */ | 750 | */ |
751 | result = d_obtain_alias(inode); | 751 | result = d_obtain_alias(inode); |
752 | if (!IS_ERR(result)) | 752 | if (!IS_ERR(result)) |
753 | result->d_op = sb->s_root->d_op; | 753 | d_set_d_op(result, sb->s_root->d_op); |
754 | return result; | 754 | return result; |
755 | } | 755 | } |
756 | 756 | ||
@@ -800,7 +800,7 @@ static struct dentry *fat_get_parent(struct dentry *child) | |||
800 | 800 | ||
801 | parent = d_obtain_alias(inode); | 801 | parent = d_obtain_alias(inode); |
802 | if (!IS_ERR(parent)) | 802 | if (!IS_ERR(parent)) |
803 | parent->d_op = sb->s_root->d_op; | 803 | d_set_d_op(parent, sb->s_root->d_op); |
804 | out: | 804 | out: |
805 | unlock_super(sb); | 805 | unlock_super(sb); |
806 | 806 | ||