From cebdbf235ed6eaf3ab5f1c0b9ea2c3c3d80b0f9a Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Sat, 30 Apr 2011 01:32:18 -0400 Subject: [PATCH] Unionfs: implement replacement for mnt_get_count Signed-off-by: Erez Zadok --- fs/unionfs/debug.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/fs/unionfs/debug.c b/fs/unionfs/debug.c index 100d2c625c3..a76f92a9f38 100644 --- a/fs/unionfs/debug.c +++ b/fs/unionfs/debug.c @@ -442,6 +442,22 @@ void __unionfs_check_nd(const struct nameidata *nd, } } +static unsigned int __mnt_get_count(struct vfsmount *mnt) +{ +#ifdef CONFIG_SMP + unsigned int count = 0; + int cpu; + + for_each_possible_cpu(cpu) { + count += per_cpu_ptr(mnt->mnt_pcp, cpu)->mnt_count; + } + + return count; +#else + return mnt->mnt_count; +#endif +} + /* useful to track vfsmount leaks that could cause EBUSY on unmount */ void __show_branch_counts(const struct super_block *sb, const char *file, const char *fxn, int line) @@ -456,7 +472,7 @@ void __show_branch_counts(const struct super_block *sb, else mnt = NULL; printk(KERN_CONT "%d:", - (mnt ? atomic_read(&mnt->mnt_count) : -99)); + (mnt ? __mnt_get_count(mnt) : -99)); } printk(KERN_CONT "%s:%s:%d\n", file, fxn, line); } -- 2.34.1