aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dcache.h
diff options
context:
space:
mode:
authorNick Piggin <npiggin@kernel.dk>2011-01-07 01:49:55 -0500
committerNick Piggin <npiggin@kernel.dk>2011-01-07 01:50:28 -0500
commitfb045adb99d9b7c562dc7fef834857f78249daa1 (patch)
tree1fd6a4024fffeec568abe100d730589bfdb81c38 /include/linux/dcache.h
parent5f57cbcc02cf18f6b22ef4066bb10afeb8f930ff (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 'include/linux/dcache.h')
-rw-r--r--include/linux/dcache.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index e4414693065e..f4b40a751f09 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -183,6 +183,11 @@ struct dentry_operations {
183#define DCACHE_GENOCIDE 0x0200 183#define DCACHE_GENOCIDE 0x0200
184#define DCACHE_MOUNTED 0x0400 /* is a mountpoint */ 184#define DCACHE_MOUNTED 0x0400 /* is a mountpoint */
185 185
186#define DCACHE_OP_HASH 0x1000
187#define DCACHE_OP_COMPARE 0x2000
188#define DCACHE_OP_REVALIDATE 0x4000
189#define DCACHE_OP_DELETE 0x8000
190
186 191
187extern spinlock_t dcache_inode_lock; 192extern spinlock_t dcache_inode_lock;
188extern seqlock_t rename_lock; 193extern seqlock_t rename_lock;
@@ -201,6 +206,7 @@ extern struct dentry * d_materialise_unique(struct dentry *, struct inode *);
201extern void __d_drop(struct dentry *dentry); 206extern void __d_drop(struct dentry *dentry);
202extern void d_drop(struct dentry *dentry); 207extern void d_drop(struct dentry *dentry);
203extern void d_delete(struct dentry *); 208extern void d_delete(struct dentry *);
209extern void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op);
204 210
205/* allocate/de-allocate */ 211/* allocate/de-allocate */
206extern struct dentry * d_alloc(struct dentry *, const struct qstr *); 212extern struct dentry * d_alloc(struct dentry *, const struct qstr *);