aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/dcache.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 047c0db5763f..98d2a948a08e 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -215,11 +215,12 @@ struct dentry_operations {
215#define DCACHE_LRU_LIST 0x00080000 215#define DCACHE_LRU_LIST 0x00080000
216 216
217#define DCACHE_ENTRY_TYPE 0x00700000 217#define DCACHE_ENTRY_TYPE 0x00700000
218#define DCACHE_MISS_TYPE 0x00000000 /* Negative dentry */ 218#define DCACHE_MISS_TYPE 0x00000000 /* Negative dentry (maybe fallthru to nowhere) */
219#define DCACHE_DIRECTORY_TYPE 0x00100000 /* Normal directory */ 219#define DCACHE_WHITEOUT_TYPE 0x00100000 /* Whiteout dentry (stop pathwalk) */
220#define DCACHE_AUTODIR_TYPE 0x00200000 /* Lookupless directory (presumed automount) */ 220#define DCACHE_DIRECTORY_TYPE 0x00200000 /* Normal directory */
221#define DCACHE_SYMLINK_TYPE 0x00300000 /* Symlink */ 221#define DCACHE_AUTODIR_TYPE 0x00300000 /* Lookupless directory (presumed automount) */
222#define DCACHE_FILE_TYPE 0x00400000 /* Other file type */ 222#define DCACHE_SYMLINK_TYPE 0x00400000 /* Symlink (or fallthru to such) */
223#define DCACHE_FILE_TYPE 0x00500000 /* Other file type (or fallthru to such) */
223 224
224#define DCACHE_MAY_FREE 0x00800000 225#define DCACHE_MAY_FREE 0x00800000
225 226
@@ -423,6 +424,16 @@ static inline unsigned __d_entry_type(const struct dentry *dentry)
423 return dentry->d_flags & DCACHE_ENTRY_TYPE; 424 return dentry->d_flags & DCACHE_ENTRY_TYPE;
424} 425}
425 426
427static inline bool d_is_miss(const struct dentry *dentry)
428{
429 return __d_entry_type(dentry) == DCACHE_MISS_TYPE;
430}
431
432static inline bool d_is_whiteout(const struct dentry *dentry)
433{
434 return __d_entry_type(dentry) == DCACHE_WHITEOUT_TYPE;
435}
436
426static inline bool d_can_lookup(const struct dentry *dentry) 437static inline bool d_can_lookup(const struct dentry *dentry)
427{ 438{
428 return __d_entry_type(dentry) == DCACHE_DIRECTORY_TYPE; 439 return __d_entry_type(dentry) == DCACHE_DIRECTORY_TYPE;
@@ -450,7 +461,8 @@ static inline bool d_is_file(const struct dentry *dentry)
450 461
451static inline bool d_is_negative(const struct dentry *dentry) 462static inline bool d_is_negative(const struct dentry *dentry)
452{ 463{
453 return __d_entry_type(dentry) == DCACHE_MISS_TYPE; 464 // TODO: check d_is_whiteout(dentry) also.
465 return d_is_miss(dentry);
454} 466}
455 467
456static inline bool d_is_positive(const struct dentry *dentry) 468static inline bool d_is_positive(const struct dentry *dentry)