From: Erez Zadok Date: Sun, 6 Mar 2011 21:37:01 +0000 (-0500) Subject: Unionfs: implement replacement for mnt_get_count X-Git-Tag: unionfs-2.5.9.2~16 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=eea2dc0fd7e31fad94d93e88e41a061613a9557e;p=unionfs-2.6.38.y.git Unionfs: implement replacement for mnt_get_count Signed-off-by: Erez Zadok --- 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); }