Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Linus Torvalds <torvalds@linux-foundation.org>

+14 -18
+1 -1
fs/dcache.c
··· 1729 1729 */ 1730 1730 if (read_seqcount_retry(&dentry->d_seq, *seq)) 1731 1731 goto seqretry; 1732 - if (parent->d_flags & DCACHE_OP_COMPARE) { 1732 + if (unlikely(parent->d_flags & DCACHE_OP_COMPARE)) { 1733 1733 if (parent->d_op->d_compare(parent, *inode, 1734 1734 dentry, i, 1735 1735 tlen, tname, name))
+13 -17
include/linux/dcache.h
··· 180 180 */ 181 181 182 182 /* d_flags entries */ 183 - #define DCACHE_AUTOFS_PENDING 0x0001 /* autofs: "under construction" */ 184 - #define DCACHE_NFSFS_RENAMED 0x0002 185 - /* this dentry has been "silly renamed" and has to be deleted on the last 186 - * dput() */ 183 + #define DCACHE_OP_HASH 0x0001 184 + #define DCACHE_OP_COMPARE 0x0002 185 + #define DCACHE_OP_REVALIDATE 0x0004 186 + #define DCACHE_OP_DELETE 0x0008 187 187 188 - #define DCACHE_DISCONNECTED 0x0004 188 + #define DCACHE_DISCONNECTED 0x0010 189 189 /* This dentry is possibly not currently connected to the dcache tree, in 190 190 * which case its parent will either be itself, or will have this flag as 191 191 * well. nfsd will not use a dentry with this bit set, but will first ··· 196 196 * dentry into place and return that dentry rather than the passed one, 197 197 * typically using d_splice_alias. */ 198 198 199 - #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ 200 - #define DCACHE_RCUACCESS 0x0010 /* Entry has ever been RCU-visible */ 201 - #define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 202 - /* Parent inode is watched by inotify */ 203 - 204 - #define DCACHE_COOKIE 0x0040 /* For use by dcookie subsystem */ 205 - #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 206 - /* Parent inode is watched by some fsnotify listener */ 199 + #define DCACHE_REFERENCED 0x0020 /* Recently used, don't discard. */ 200 + #define DCACHE_RCUACCESS 0x0040 /* Entry has ever been RCU-visible */ 207 201 208 202 #define DCACHE_CANT_MOUNT 0x0100 209 203 #define DCACHE_GENOCIDE 0x0200 210 204 211 - #define DCACHE_OP_HASH 0x1000 212 - #define DCACHE_OP_COMPARE 0x2000 213 - #define DCACHE_OP_REVALIDATE 0x4000 214 - #define DCACHE_OP_DELETE 0x8000 205 + #define DCACHE_NFSFS_RENAMED 0x1000 206 + /* this dentry has been "silly renamed" and has to be deleted on the last 207 + * dput() */ 208 + #define DCACHE_COOKIE 0x2000 /* For use by dcookie subsystem */ 209 + #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x4000 210 + /* Parent inode is watched by some fsnotify listener */ 215 211 216 212 #define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ 217 213 #define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */