Messages in this thread Patch in this message | | | From | Waiman Long <> | Subject | [PATCH v6 03/14] dcache: Add a new helper function d_count() to return refcount | Date | Mon, 8 Jul 2013 21:09:53 -0400 |
| |
This patch adds a new helper function d_count() in dcache.h for returning the current reference count of the dentry object. It should be used by all the files outside of the core dcache.c and namei.c files.
Signed-off-by: Waiman Long <Waiman.Long@hp.com> --- include/linux/dcache.h | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index f42dbe1..7c6bbf0 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -258,6 +258,16 @@ extern int have_submounts(struct dentry *); extern void d_rehash(struct dentry *); /** + * d_count - return the reference count in dentry + * @entry: dentry pointer + * Returns: current value of reference count + */ +static inline unsigned int d_count(struct dentry *entry) +{ + return entry->d_count; +} + +/** * d_add - add dentry to hash queues * @entry: dentry to add * @inode: The inode to attach to this dentry -- 1.7.1
| |