]> git.karo-electronics.de Git - linux-beck.git/commitdiff
vfs: kill pointless helpers in namespace.c
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 24 Nov 2011 00:04:52 +0000 (19:04 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 4 Jan 2012 03:52:36 +0000 (22:52 -0500)
mnt_{inc,dec}_count() is not cleaner than doing the corresponding
mnt_add_count() directly and mnt_set_count() is not used at all.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namespace.c

index cfc6d4448aa54bdc538131b1e53285a92bb20073..31d357450f7fc0bf247bb53afd1f200bd0b3cb2a 100644 (file)
@@ -152,31 +152,6 @@ static inline void mnt_add_count(struct vfsmount *mnt, int n)
 #endif
 }
 
-static inline void mnt_set_count(struct vfsmount *mnt, int n)
-{
-#ifdef CONFIG_SMP
-       this_cpu_write(mnt->mnt_pcp->mnt_count, n);
-#else
-       mnt->mnt_count = n;
-#endif
-}
-
-/*
- * vfsmount lock must be held for read
- */
-static inline void mnt_inc_count(struct vfsmount *mnt)
-{
-       mnt_add_count(mnt, 1);
-}
-
-/*
- * vfsmount lock must be held for read
- */
-static inline void mnt_dec_count(struct vfsmount *mnt)
-{
-       mnt_add_count(mnt, -1);
-}
-
 /*
  * vfsmount lock must be held for write
  */
@@ -780,20 +755,20 @@ put_again:
 #ifdef CONFIG_SMP
        br_read_lock(vfsmount_lock);
        if (likely(atomic_read(&mnt->mnt_longterm))) {
-               mnt_dec_count(mnt);
+               mnt_add_count(mnt, -1);
                br_read_unlock(vfsmount_lock);
                return;
        }
        br_read_unlock(vfsmount_lock);
 
        br_write_lock(vfsmount_lock);
-       mnt_dec_count(mnt);
+       mnt_add_count(mnt, -1);
        if (mnt_get_count(mnt)) {
                br_write_unlock(vfsmount_lock);
                return;
        }
 #else
-       mnt_dec_count(mnt);
+       mnt_add_count(mnt, -1);
        if (likely(mnt_get_count(mnt)))
                return;
        br_write_lock(vfsmount_lock);
@@ -823,7 +798,7 @@ EXPORT_SYMBOL(mntput);
 struct vfsmount *mntget(struct vfsmount *mnt)
 {
        if (mnt)
-               mnt_inc_count(mnt);
+               mnt_add_count(mnt, 1);
        return mnt;
 }
 EXPORT_SYMBOL(mntget);
@@ -840,7 +815,7 @@ void mnt_unpin(struct vfsmount *mnt)
 {
        br_write_lock(vfsmount_lock);
        if (mnt->mnt_pinned) {
-               mnt_inc_count(mnt);
+               mnt_add_count(mnt, 1);
                mnt->mnt_pinned--;
        }
        br_write_unlock(vfsmount_lock);