summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/dcache.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index d8358799c594..e83768ee38fc 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -482,6 +482,44 @@ static inline bool d_is_positive(const struct dentry *dentry)
482 return !d_is_negative(dentry); 482 return !d_is_negative(dentry);
483} 483}
484 484
485/**
486 * d_really_is_negative - Determine if a dentry is really negative (ignoring fallthroughs)
487 * @dentry: The dentry in question
488 *
489 * Returns true if the dentry represents either an absent name or a name that
490 * doesn't map to an inode (ie. ->d_inode is NULL). The dentry could represent
491 * a true miss, a whiteout that isn't represented by a 0,0 chardev or a
492 * fallthrough marker in an opaque directory.
493 *
494 * Note! (1) This should be used *only* by a filesystem to examine its own
495 * dentries. It should not be used to look at some other filesystem's
496 * dentries. (2) It should also be used in combination with d_inode() to get
497 * the inode. (3) The dentry may have something attached to ->d_lower and the
498 * type field of the flags may be set to something other than miss or whiteout.
499 */
500static inline bool d_really_is_negative(const struct dentry *dentry)
501{
502 return dentry->d_inode == NULL;
503}
504
505/**
506 * d_really_is_positive - Determine if a dentry is really positive (ignoring fallthroughs)
507 * @dentry: The dentry in question
508 *
509 * Returns true if the dentry represents a name that maps to an inode
510 * (ie. ->d_inode is not NULL). The dentry might still represent a whiteout if
511 * that is represented on medium as a 0,0 chardev.
512 *
513 * Note! (1) This should be used *only* by a filesystem to examine its own
514 * dentries. It should not be used to look at some other filesystem's
515 * dentries. (2) It should also be used in combination with d_inode() to get
516 * the inode.
517 */
518static inline bool d_really_is_positive(const struct dentry *dentry)
519{
520 return dentry->d_inode != NULL;
521}
522
485extern void d_set_fallthru(struct dentry *dentry); 523extern void d_set_fallthru(struct dentry *dentry);
486 524
487static inline bool d_is_fallthru(const struct dentry *dentry) 525static inline bool d_is_fallthru(const struct dentry *dentry)