@@ -151,13 +151,13 @@ struct dentry_operations {
151151 */
152152
153153/* d_flags entries */
154- #define DCACHE_OP_HASH 0x00000001
155- #define DCACHE_OP_COMPARE 0x00000002
156- #define DCACHE_OP_REVALIDATE 0x00000004
157- #define DCACHE_OP_DELETE 0x00000008
158- #define DCACHE_OP_PRUNE 0x00000010
154+ #define DCACHE_OP_HASH BIT(0)
155+ #define DCACHE_OP_COMPARE BIT(1)
156+ #define DCACHE_OP_REVALIDATE BIT(2)
157+ #define DCACHE_OP_DELETE BIT(3)
158+ #define DCACHE_OP_PRUNE BIT(4)
159159
160- #define DCACHE_DISCONNECTED 0x00000020
160+ #define DCACHE_DISCONNECTED BIT(5)
161161 /* This dentry is possibly not currently connected to the dcache tree, in
162162 * which case its parent will either be itself, or will have this flag as
163163 * well. nfsd will not use a dentry with this bit set, but will first
@@ -168,50 +168,50 @@ struct dentry_operations {
168168 * dentry into place and return that dentry rather than the passed one,
169169 * typically using d_splice_alias. */
170170
171- #define DCACHE_REFERENCED 0x00000040 /* Recently used, don't discard. */
171+ #define DCACHE_REFERENCED BIT(6) /* Recently used, don't discard. */
172172
173- #define DCACHE_DONTCACHE 0x00000080 /* Purge from memory on final dput() */
173+ #define DCACHE_DONTCACHE BIT(7) /* Purge from memory on final dput() */
174174
175- #define DCACHE_CANT_MOUNT 0x00000100
176- #define DCACHE_GENOCIDE 0x00000200
177- #define DCACHE_SHRINK_LIST 0x00000400
175+ #define DCACHE_CANT_MOUNT BIT(8)
176+ #define DCACHE_GENOCIDE BIT(9)
177+ #define DCACHE_SHRINK_LIST BIT(10)
178178
179- #define DCACHE_OP_WEAK_REVALIDATE 0x00000800
179+ #define DCACHE_OP_WEAK_REVALIDATE BIT(11)
180180
181- #define DCACHE_NFSFS_RENAMED 0x00001000
181+ #define DCACHE_NFSFS_RENAMED BIT(12)
182182 /* this dentry has been "silly renamed" and has to be deleted on the last
183183 * dput() */
184- #define DCACHE_COOKIE 0x00002000 /* For use by dcookie subsystem */
185- #define DCACHE_FSNOTIFY_PARENT_WATCHED 0x00004000
184+ #define DCACHE_COOKIE BIT(13) /* For use by dcookie subsystem */
185+ #define DCACHE_FSNOTIFY_PARENT_WATCHED BIT(14)
186186 /* Parent inode is watched by some fsnotify listener */
187187
188- #define DCACHE_DENTRY_KILLED 0x00008000
188+ #define DCACHE_DENTRY_KILLED BIT(15)
189189
190- #define DCACHE_MOUNTED 0x00010000 /* is a mountpoint */
191- #define DCACHE_NEED_AUTOMOUNT 0x00020000 /* handle automount on this dir */
192- #define DCACHE_MANAGE_TRANSIT 0x00040000 /* manage transit from this dirent */
190+ #define DCACHE_MOUNTED BIT(16) /* is a mountpoint */
191+ #define DCACHE_NEED_AUTOMOUNT BIT(17) /* handle automount on this dir */
192+ #define DCACHE_MANAGE_TRANSIT BIT(18) /* manage transit from this dirent */
193193#define DCACHE_MANAGED_DENTRY \
194194 (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT)
195195
196- #define DCACHE_LRU_LIST 0x00080000
197-
198- #define DCACHE_ENTRY_TYPE 0x00700000
199- #define DCACHE_MISS_TYPE 0x00000000 /* Negative dentry (maybe fallthru to nowhere) */
200- #define DCACHE_WHITEOUT_TYPE 0x00100000 /* Whiteout dentry (stop pathwalk) */
201- #define DCACHE_DIRECTORY_TYPE 0x00200000 /* Normal directory */
202- #define DCACHE_AUTODIR_TYPE 0x00300000 /* Lookupless directory (presumed automount) */
203- #define DCACHE_REGULAR_TYPE 0x00400000 /* Regular file type (or fallthru to such) */
204- #define DCACHE_SPECIAL_TYPE 0x00500000 /* Other file type (or fallthru to such) */
205- #define DCACHE_SYMLINK_TYPE 0x00600000 /* Symlink (or fallthru to such) */
206-
207- #define DCACHE_MAY_FREE 0x00800000
208- #define DCACHE_FALLTHRU 0x01000000 /* Fall through to lower layer */
209- #define DCACHE_NOKEY_NAME 0x02000000 /* Encrypted name encoded without key */
210- #define DCACHE_OP_REAL 0x04000000
211-
212- #define DCACHE_PAR_LOOKUP 0x10000000 /* being looked up (with parent locked shared) */
213- #define DCACHE_DENTRY_CURSOR 0x20000000
214- #define DCACHE_NORCU 0x40000000 /* No RCU delay for freeing */
196+ #define DCACHE_LRU_LIST BIT(19)
197+
198+ #define DCACHE_ENTRY_TYPE (7 << 20) /* bits 20..22 are for storing type: */
199+ #define DCACHE_MISS_TYPE (0 << 20) /* Negative dentry (maybe fallthru to nowhere) */
200+ #define DCACHE_WHITEOUT_TYPE (1 << 20) /* Whiteout dentry (stop pathwalk) */
201+ #define DCACHE_DIRECTORY_TYPE (2 << 20) /* Normal directory */
202+ #define DCACHE_AUTODIR_TYPE (3 << 20) /* Lookupless directory (presumed automount) */
203+ #define DCACHE_REGULAR_TYPE (4 << 20) /* Regular file type (or fallthru to such) */
204+ #define DCACHE_SPECIAL_TYPE (5 << 20) /* Other file type (or fallthru to such) */
205+ #define DCACHE_SYMLINK_TYPE (6 << 20) /* Symlink (or fallthru to such) */
206+
207+ #define DCACHE_MAY_FREE BIT(23)
208+ #define DCACHE_FALLTHRU BIT(24) /* Fall through to lower layer */
209+ #define DCACHE_NOKEY_NAME BIT(25) /* Encrypted name encoded without key */
210+ #define DCACHE_OP_REAL BIT(26)
211+
212+ #define DCACHE_PAR_LOOKUP BIT(28) /* being looked up (with parent locked shared) */
213+ #define DCACHE_DENTRY_CURSOR BIT(29)
214+ #define DCACHE_NORCU BIT(30) /* No RCU delay for freeing */
215215
216216extern seqlock_t rename_lock ;
217217
0 commit comments