aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2006-03-27 04:14:51 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 11:44:40 -0500
commite3474a8eb38e48dea6690d1fabd75f3c7fd2f93f (patch)
tree0eb85dea5d7ae7bab9e22b139f5757c67294402e
parent90a59c7cf5dd68b41ffab61dd30eba1ef5746e66 (diff)
[PATCH] autofs4: change may_umount* functions to boolean
Change the functions may_umount and may_umount_tree to boolean functions to aid code readability. Signed-off-by: Ian Kent <raven@themaw.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/autofs/dirhash.c2
-rw-r--r--fs/autofs4/expire.c2
-rw-r--r--fs/autofs4/root.c2
-rw-r--r--fs/namespace.c8
4 files changed, 7 insertions, 7 deletions
diff --git a/fs/autofs/dirhash.c b/fs/autofs/dirhash.c
index 5ccfcf26310d..3fded389d06b 100644
--- a/fs/autofs/dirhash.c
+++ b/fs/autofs/dirhash.c
@@ -92,7 +92,7 @@ struct autofs_dir_ent *autofs_expire(struct super_block *sb,
92 ; 92 ;
93 dput(dentry); 93 dput(dentry);
94 94
95 if ( may_umount(mnt) == 0 ) { 95 if ( may_umount(mnt) ) {
96 mntput(mnt); 96 mntput(mnt);
97 DPRINTK(("autofs: signaling expire on %s\n", ent->name)); 97 DPRINTK(("autofs: signaling expire on %s\n", ent->name));
98 return ent; /* Expirable! */ 98 return ent; /* Expirable! */
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index 6ae2fc8233ff..02a218fbde5f 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -64,7 +64,7 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
64 goto done; 64 goto done;
65 65
66 /* Update the expiry counter if fs is busy */ 66 /* Update the expiry counter if fs is busy */
67 if (may_umount_tree(mnt)) { 67 if (!may_umount_tree(mnt)) {
68 struct autofs_info *ino = autofs4_dentry_ino(top); 68 struct autofs_info *ino = autofs4_dentry_ino(top);
69 ino->last_used = jiffies; 69 ino->last_used = jiffies;
70 goto done; 70 goto done;
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index dcd4802a5d5f..26eb1f024866 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -699,7 +699,7 @@ static inline int autofs4_ask_umount(struct vfsmount *mnt, int __user *p)
699{ 699{
700 int status = 0; 700 int status = 0;
701 701
702 if (may_umount(mnt) == 0) 702 if (may_umount(mnt))
703 status = 1; 703 status = 1;
704 704
705 DPRINTK("returning %d", status); 705 DPRINTK("returning %d", status);
diff --git a/fs/namespace.c b/fs/namespace.c
index e069a4c5e389..bf478addb852 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -459,9 +459,9 @@ int may_umount_tree(struct vfsmount *mnt)
459 spin_unlock(&vfsmount_lock); 459 spin_unlock(&vfsmount_lock);
460 460
461 if (actual_refs > minimum_refs) 461 if (actual_refs > minimum_refs)
462 return -EBUSY; 462 return 0;
463 463
464 return 0; 464 return 1;
465} 465}
466 466
467EXPORT_SYMBOL(may_umount_tree); 467EXPORT_SYMBOL(may_umount_tree);
@@ -481,10 +481,10 @@ EXPORT_SYMBOL(may_umount_tree);
481 */ 481 */
482int may_umount(struct vfsmount *mnt) 482int may_umount(struct vfsmount *mnt)
483{ 483{
484 int ret = 0; 484 int ret = 1;
485 spin_lock(&vfsmount_lock); 485 spin_lock(&vfsmount_lock);
486 if (propagate_mount_busy(mnt, 2)) 486 if (propagate_mount_busy(mnt, 2))
487 ret = -EBUSY; 487 ret = 0;
488 spin_unlock(&vfsmount_lock); 488 spin_unlock(&vfsmount_lock);
489 return ret; 489 return ret;
490} 490}