Commit 830c0f0e authored by Linus Torvalds's avatar Linus Torvalds

vfs: renumber DCACHE_xyz flags, remove some stale ones

Gcc tends to generate better code with small integers, including the
DCACHE_xyz flag tests - so move the common ones to be first in the list.
Also just remove the unused DCACHE_INOTIFY_PARENT_WATCHED and
DCACHE_AUTOFS_PENDING values, their users no longer exists in the source
tree.

And add a "unlikely()" to the DCACHE_OP_COMPARE test, since we want the
common case to be a nice straight-line fall-through.
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7cd4767e
...@@ -1729,7 +1729,7 @@ struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name, ...@@ -1729,7 +1729,7 @@ struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name,
*/ */
if (read_seqcount_retry(&dentry->d_seq, *seq)) if (read_seqcount_retry(&dentry->d_seq, *seq))
goto seqretry; goto seqretry;
if (parent->d_flags & DCACHE_OP_COMPARE) { if (unlikely(parent->d_flags & DCACHE_OP_COMPARE)) {
if (parent->d_op->d_compare(parent, *inode, if (parent->d_op->d_compare(parent, *inode,
dentry, i, dentry, i,
tlen, tname, name)) tlen, tname, name))
......
...@@ -180,12 +180,12 @@ struct dentry_operations { ...@@ -180,12 +180,12 @@ struct dentry_operations {
*/ */
/* d_flags entries */ /* d_flags entries */
#define DCACHE_AUTOFS_PENDING 0x0001 /* autofs: "under construction" */ #define DCACHE_OP_HASH 0x0001
#define DCACHE_NFSFS_RENAMED 0x0002 #define DCACHE_OP_COMPARE 0x0002
/* this dentry has been "silly renamed" and has to be deleted on the last #define DCACHE_OP_REVALIDATE 0x0004
* dput() */ #define DCACHE_OP_DELETE 0x0008
#define DCACHE_DISCONNECTED 0x0004 #define DCACHE_DISCONNECTED 0x0010
/* This dentry is possibly not currently connected to the dcache tree, in /* This dentry is possibly not currently connected to the dcache tree, in
* which case its parent will either be itself, or will have this flag as * which case its parent will either be itself, or will have this flag as
* well. nfsd will not use a dentry with this bit set, but will first * well. nfsd will not use a dentry with this bit set, but will first
...@@ -196,22 +196,18 @@ struct dentry_operations { ...@@ -196,22 +196,18 @@ struct dentry_operations {
* dentry into place and return that dentry rather than the passed one, * dentry into place and return that dentry rather than the passed one,
* typically using d_splice_alias. */ * typically using d_splice_alias. */
#define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ #define DCACHE_REFERENCED 0x0020 /* Recently used, don't discard. */
#define DCACHE_RCUACCESS 0x0010 /* Entry has ever been RCU-visible */ #define DCACHE_RCUACCESS 0x0040 /* Entry has ever been RCU-visible */
#define DCACHE_INOTIFY_PARENT_WATCHED 0x0020
/* Parent inode is watched by inotify */
#define DCACHE_COOKIE 0x0040 /* For use by dcookie subsystem */
#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080
/* Parent inode is watched by some fsnotify listener */
#define DCACHE_CANT_MOUNT 0x0100 #define DCACHE_CANT_MOUNT 0x0100
#define DCACHE_GENOCIDE 0x0200 #define DCACHE_GENOCIDE 0x0200
#define DCACHE_OP_HASH 0x1000 #define DCACHE_NFSFS_RENAMED 0x1000
#define DCACHE_OP_COMPARE 0x2000 /* this dentry has been "silly renamed" and has to be deleted on the last
#define DCACHE_OP_REVALIDATE 0x4000 * dput() */
#define DCACHE_OP_DELETE 0x8000 #define DCACHE_COOKIE 0x2000 /* For use by dcookie subsystem */
#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x4000
/* Parent inode is watched by some fsnotify listener */
#define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ #define DCACHE_MOUNTED 0x10000 /* is a mountpoint */
#define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ #define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment