Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752758Ab3GIBVb (ORCPT ); Mon, 8 Jul 2013 21:21:31 -0400 Received: from g5t0007.atlanta.hp.com ([15.192.0.44]:11427 "EHLO g5t0007.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751792Ab3GIBRl (ORCPT ); Mon, 8 Jul 2013 21:17:41 -0400 From: Waiman Long Cc: Waiman Long , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Steven Rostedt , Linus Torvalds , Benjamin Herrenschmidt , Andi Kleen , "Chandramouleeswaran, Aswin" , "Norton, Scott J" 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 Message-Id: <1373332204-10379-4-git-send-email-Waiman.Long@hp.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1373332204-10379-1-git-send-email-Waiman.Long@hp.com> References: <1373332204-10379-1-git-send-email-Waiman.Long@hp.com> To: Alexander Viro , Jeff Layton , Miklos Szeredi , Ingo Molnar , Thomas Gleixner Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1207 Lines: 39 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/