diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-11-23 19:04:52 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-03 22:52:36 -0500 |
commit | aa9c0e07bb90589186f3b5a0ca97660c2cb50806 (patch) | |
tree | 0e2e179f41b2d7566817c0a0e05e03749fa56db0 /fs/namespace.c | |
parent | bad0dcffc21d17a07dbb83a2bf764f35a57feba5 (diff) |
vfs: kill pointless helpers in namespace.c
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>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r-- | fs/namespace.c | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index cfc6d4448aa5..31d357450f7f 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -152,31 +152,6 @@ static inline void mnt_add_count(struct vfsmount *mnt, int n) | |||
152 | #endif | 152 | #endif |
153 | } | 153 | } |
154 | 154 | ||
155 | static inline void mnt_set_count(struct vfsmount *mnt, int n) | ||
156 | { | ||
157 | #ifdef CONFIG_SMP | ||
158 | this_cpu_write(mnt->mnt_pcp->mnt_count, n); | ||
159 | #else | ||
160 | mnt->mnt_count = n; | ||
161 | #endif | ||
162 | } | ||
163 | |||
164 | /* | ||
165 | * vfsmount lock must be held for read | ||
166 | */ | ||
167 | static inline void mnt_inc_count(struct vfsmount *mnt) | ||
168 | { | ||
169 | mnt_add_count(mnt, 1); | ||
170 | } | ||
171 | |||
172 | /* | ||
173 | * vfsmount lock must be held for read | ||
174 | */ | ||
175 | static inline void mnt_dec_count(struct vfsmount *mnt) | ||
176 | { | ||
177 | mnt_add_count(mnt, -1); | ||
178 | } | ||
179 | |||
180 | /* | 155 | /* |
181 | * vfsmount lock must be held for write | 156 | * vfsmount lock must be held for write |
182 | */ | 157 | */ |
@@ -780,20 +755,20 @@ put_again: | |||
780 | #ifdef CONFIG_SMP | 755 | #ifdef CONFIG_SMP |
781 | br_read_lock(vfsmount_lock); | 756 | br_read_lock(vfsmount_lock); |
782 | if (likely(atomic_read(&mnt->mnt_longterm))) { | 757 | if (likely(atomic_read(&mnt->mnt_longterm))) { |
783 | mnt_dec_count(mnt); | 758 | mnt_add_count(mnt, -1); |
784 | br_read_unlock(vfsmount_lock); | 759 | br_read_unlock(vfsmount_lock); |
785 | return; | 760 | return; |
786 | } | 761 | } |
787 | br_read_unlock(vfsmount_lock); | 762 | br_read_unlock(vfsmount_lock); |
788 | 763 | ||
789 | br_write_lock(vfsmount_lock); | 764 | br_write_lock(vfsmount_lock); |
790 | mnt_dec_count(mnt); | 765 | mnt_add_count(mnt, -1); |
791 | if (mnt_get_count(mnt)) { | 766 | if (mnt_get_count(mnt)) { |
792 | br_write_unlock(vfsmount_lock); | 767 | br_write_unlock(vfsmount_lock); |
793 | return; | 768 | return; |
794 | } | 769 | } |
795 | #else | 770 | #else |
796 | mnt_dec_count(mnt); | 771 | mnt_add_count(mnt, -1); |
797 | if (likely(mnt_get_count(mnt))) | 772 | if (likely(mnt_get_count(mnt))) |
798 | return; | 773 | return; |
799 | br_write_lock(vfsmount_lock); | 774 | br_write_lock(vfsmount_lock); |
@@ -823,7 +798,7 @@ EXPORT_SYMBOL(mntput); | |||
823 | struct vfsmount *mntget(struct vfsmount *mnt) | 798 | struct vfsmount *mntget(struct vfsmount *mnt) |
824 | { | 799 | { |
825 | if (mnt) | 800 | if (mnt) |
826 | mnt_inc_count(mnt); | 801 | mnt_add_count(mnt, 1); |
827 | return mnt; | 802 | return mnt; |
828 | } | 803 | } |
829 | EXPORT_SYMBOL(mntget); | 804 | EXPORT_SYMBOL(mntget); |
@@ -840,7 +815,7 @@ void mnt_unpin(struct vfsmount *mnt) | |||
840 | { | 815 | { |
841 | br_write_lock(vfsmount_lock); | 816 | br_write_lock(vfsmount_lock); |
842 | if (mnt->mnt_pinned) { | 817 | if (mnt->mnt_pinned) { |
843 | mnt_inc_count(mnt); | 818 | mnt_add_count(mnt, 1); |
844 | mnt->mnt_pinned--; | 819 | mnt->mnt_pinned--; |
845 | } | 820 | } |
846 | br_write_unlock(vfsmount_lock); | 821 | br_write_unlock(vfsmount_lock); |