diff options
author | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:50:10 -0500 |
---|---|---|
committer | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:50:33 -0500 |
commit | c6653a838b1b2738561aff0b8c0f62a9b714bdd9 (patch) | |
tree | 42ab45defd51c23dde7b91bafe62a28509befaf8 | |
parent | 9d55c369bb5e695e629bc35cba2ef607755b3bee (diff) |
fs: rename vfsmount counter helpers
Suggested by Andreas, mnt_ prefix is clearer namespace, follows kernel
conventions better, and is easier for tab complete. I introduced these
names so I'll admit they were not good choices.
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
-rw-r--r-- | fs/namespace.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 39a7d507fba0..03b82350f020 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -216,7 +216,7 @@ int __mnt_is_readonly(struct vfsmount *mnt) | |||
216 | } | 216 | } |
217 | EXPORT_SYMBOL_GPL(__mnt_is_readonly); | 217 | EXPORT_SYMBOL_GPL(__mnt_is_readonly); |
218 | 218 | ||
219 | static inline void inc_mnt_writers(struct vfsmount *mnt) | 219 | static inline void mnt_inc_writers(struct vfsmount *mnt) |
220 | { | 220 | { |
221 | #ifdef CONFIG_SMP | 221 | #ifdef CONFIG_SMP |
222 | (*per_cpu_ptr(mnt->mnt_writers, smp_processor_id()))++; | 222 | (*per_cpu_ptr(mnt->mnt_writers, smp_processor_id()))++; |
@@ -225,7 +225,7 @@ static inline void inc_mnt_writers(struct vfsmount *mnt) | |||
225 | #endif | 225 | #endif |
226 | } | 226 | } |
227 | 227 | ||
228 | static inline void dec_mnt_writers(struct vfsmount *mnt) | 228 | static inline void mnt_dec_writers(struct vfsmount *mnt) |
229 | { | 229 | { |
230 | #ifdef CONFIG_SMP | 230 | #ifdef CONFIG_SMP |
231 | (*per_cpu_ptr(mnt->mnt_writers, smp_processor_id()))--; | 231 | (*per_cpu_ptr(mnt->mnt_writers, smp_processor_id()))--; |
@@ -234,7 +234,7 @@ static inline void dec_mnt_writers(struct vfsmount *mnt) | |||
234 | #endif | 234 | #endif |
235 | } | 235 | } |
236 | 236 | ||
237 | static unsigned int count_mnt_writers(struct vfsmount *mnt) | 237 | static unsigned int mnt_get_writers(struct vfsmount *mnt) |
238 | { | 238 | { |
239 | #ifdef CONFIG_SMP | 239 | #ifdef CONFIG_SMP |
240 | unsigned int count = 0; | 240 | unsigned int count = 0; |
@@ -273,9 +273,9 @@ int mnt_want_write(struct vfsmount *mnt) | |||
273 | int ret = 0; | 273 | int ret = 0; |
274 | 274 | ||
275 | preempt_disable(); | 275 | preempt_disable(); |
276 | inc_mnt_writers(mnt); | 276 | mnt_inc_writers(mnt); |
277 | /* | 277 | /* |
278 | * The store to inc_mnt_writers must be visible before we pass | 278 | * The store to mnt_inc_writers must be visible before we pass |
279 | * MNT_WRITE_HOLD loop below, so that the slowpath can see our | 279 | * MNT_WRITE_HOLD loop below, so that the slowpath can see our |
280 | * incremented count after it has set MNT_WRITE_HOLD. | 280 | * incremented count after it has set MNT_WRITE_HOLD. |
281 | */ | 281 | */ |
@@ -289,7 +289,7 @@ int mnt_want_write(struct vfsmount *mnt) | |||
289 | */ | 289 | */ |
290 | smp_rmb(); | 290 | smp_rmb(); |
291 | if (__mnt_is_readonly(mnt)) { | 291 | if (__mnt_is_readonly(mnt)) { |
292 | dec_mnt_writers(mnt); | 292 | mnt_dec_writers(mnt); |
293 | ret = -EROFS; | 293 | ret = -EROFS; |
294 | goto out; | 294 | goto out; |
295 | } | 295 | } |
@@ -317,7 +317,7 @@ int mnt_clone_write(struct vfsmount *mnt) | |||
317 | if (__mnt_is_readonly(mnt)) | 317 | if (__mnt_is_readonly(mnt)) |
318 | return -EROFS; | 318 | return -EROFS; |
319 | preempt_disable(); | 319 | preempt_disable(); |
320 | inc_mnt_writers(mnt); | 320 | mnt_inc_writers(mnt); |
321 | preempt_enable(); | 321 | preempt_enable(); |
322 | return 0; | 322 | return 0; |
323 | } | 323 | } |
@@ -351,7 +351,7 @@ EXPORT_SYMBOL_GPL(mnt_want_write_file); | |||
351 | void mnt_drop_write(struct vfsmount *mnt) | 351 | void mnt_drop_write(struct vfsmount *mnt) |
352 | { | 352 | { |
353 | preempt_disable(); | 353 | preempt_disable(); |
354 | dec_mnt_writers(mnt); | 354 | mnt_dec_writers(mnt); |
355 | preempt_enable(); | 355 | preempt_enable(); |
356 | } | 356 | } |
357 | EXPORT_SYMBOL_GPL(mnt_drop_write); | 357 | EXPORT_SYMBOL_GPL(mnt_drop_write); |
@@ -384,7 +384,7 @@ static int mnt_make_readonly(struct vfsmount *mnt) | |||
384 | * MNT_WRITE_HOLD, so it can't be decremented by another CPU while | 384 | * MNT_WRITE_HOLD, so it can't be decremented by another CPU while |
385 | * we're counting up here. | 385 | * we're counting up here. |
386 | */ | 386 | */ |
387 | if (count_mnt_writers(mnt) > 0) | 387 | if (mnt_get_writers(mnt) > 0) |
388 | ret = -EBUSY; | 388 | ret = -EBUSY; |
389 | else | 389 | else |
390 | mnt->mnt_flags |= MNT_READONLY; | 390 | mnt->mnt_flags |= MNT_READONLY; |
@@ -663,9 +663,9 @@ static inline void __mntput(struct vfsmount *mnt) | |||
663 | */ | 663 | */ |
664 | /* | 664 | /* |
665 | * atomic_dec_and_lock() used to deal with ->mnt_count decrements | 665 | * atomic_dec_and_lock() used to deal with ->mnt_count decrements |
666 | * provides barriers, so count_mnt_writers() below is safe. AV | 666 | * provides barriers, so mnt_get_writers() below is safe. AV |
667 | */ | 667 | */ |
668 | WARN_ON(count_mnt_writers(mnt)); | 668 | WARN_ON(mnt_get_writers(mnt)); |
669 | fsnotify_vfsmount_delete(mnt); | 669 | fsnotify_vfsmount_delete(mnt); |
670 | dput(mnt->mnt_root); | 670 | dput(mnt->mnt_root); |
671 | free_vfsmnt(mnt); | 671 | free_vfsmnt(mnt); |