Skip to content

Commit c6653a8

Browse files
author
Nick Piggin
committed
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 <[email protected]>
1 parent 9d55c36 commit c6653a8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

fs/namespace.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ int __mnt_is_readonly(struct vfsmount *mnt)
216216
}
217217
EXPORT_SYMBOL_GPL(__mnt_is_readonly);
218218

219-
static inline void inc_mnt_writers(struct vfsmount *mnt)
219+
static inline void mnt_inc_writers(struct vfsmount *mnt)
220220
{
221221
#ifdef CONFIG_SMP
222222
(*per_cpu_ptr(mnt->mnt_writers, smp_processor_id()))++;
@@ -225,7 +225,7 @@ static inline void inc_mnt_writers(struct vfsmount *mnt)
225225
#endif
226226
}
227227

228-
static inline void dec_mnt_writers(struct vfsmount *mnt)
228+
static inline void mnt_dec_writers(struct vfsmount *mnt)
229229
{
230230
#ifdef CONFIG_SMP
231231
(*per_cpu_ptr(mnt->mnt_writers, smp_processor_id()))--;
@@ -234,7 +234,7 @@ static inline void dec_mnt_writers(struct vfsmount *mnt)
234234
#endif
235235
}
236236

237-
static unsigned int count_mnt_writers(struct vfsmount *mnt)
237+
static unsigned int mnt_get_writers(struct vfsmount *mnt)
238238
{
239239
#ifdef CONFIG_SMP
240240
unsigned int count = 0;
@@ -273,9 +273,9 @@ int mnt_want_write(struct vfsmount *mnt)
273273
int ret = 0;
274274

275275
preempt_disable();
276-
inc_mnt_writers(mnt);
276+
mnt_inc_writers(mnt);
277277
/*
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
279279
* MNT_WRITE_HOLD loop below, so that the slowpath can see our
280280
* incremented count after it has set MNT_WRITE_HOLD.
281281
*/
@@ -289,7 +289,7 @@ int mnt_want_write(struct vfsmount *mnt)
289289
*/
290290
smp_rmb();
291291
if (__mnt_is_readonly(mnt)) {
292-
dec_mnt_writers(mnt);
292+
mnt_dec_writers(mnt);
293293
ret = -EROFS;
294294
goto out;
295295
}
@@ -317,7 +317,7 @@ int mnt_clone_write(struct vfsmount *mnt)
317317
if (__mnt_is_readonly(mnt))
318318
return -EROFS;
319319
preempt_disable();
320-
inc_mnt_writers(mnt);
320+
mnt_inc_writers(mnt);
321321
preempt_enable();
322322
return 0;
323323
}
@@ -351,7 +351,7 @@ EXPORT_SYMBOL_GPL(mnt_want_write_file);
351351
void mnt_drop_write(struct vfsmount *mnt)
352352
{
353353
preempt_disable();
354-
dec_mnt_writers(mnt);
354+
mnt_dec_writers(mnt);
355355
preempt_enable();
356356
}
357357
EXPORT_SYMBOL_GPL(mnt_drop_write);
@@ -384,7 +384,7 @@ static int mnt_make_readonly(struct vfsmount *mnt)
384384
* MNT_WRITE_HOLD, so it can't be decremented by another CPU while
385385
* we're counting up here.
386386
*/
387-
if (count_mnt_writers(mnt) > 0)
387+
if (mnt_get_writers(mnt) > 0)
388388
ret = -EBUSY;
389389
else
390390
mnt->mnt_flags |= MNT_READONLY;
@@ -663,9 +663,9 @@ static inline void __mntput(struct vfsmount *mnt)
663663
*/
664664
/*
665665
* 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
667667
*/
668-
WARN_ON(count_mnt_writers(mnt));
668+
WARN_ON(mnt_get_writers(mnt));
669669
fsnotify_vfsmount_delete(mnt);
670670
dput(mnt->mnt_root);
671671
free_vfsmnt(mnt);

0 commit comments

Comments
 (0)