]> err.no Git - linux-2.6/commitdiff
[PATCH] autofs4: change may_umount* functions to boolean
authorIan Kent <raven@themaw.net>
Mon, 27 Mar 2006 09:14:51 +0000 (01:14 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 27 Mar 2006 16:44:40 +0000 (08:44 -0800)
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>
fs/autofs/dirhash.c
fs/autofs4/expire.c
fs/autofs4/root.c
fs/namespace.c

index 5ccfcf26310d7ac6c000541300bedaae83dd267d..3fded389d06b9fe1e1d8df20f08ac541b87f9bb1 100644 (file)
@@ -92,7 +92,7 @@ struct autofs_dir_ent *autofs_expire(struct super_block *sb,
                        ;
                dput(dentry);
 
-               if ( may_umount(mnt) == 0 ) {
+               if ( may_umount(mnt) ) {
                        mntput(mnt);
                        DPRINTK(("autofs: signaling expire on %s\n", ent->name));
                        return ent; /* Expirable! */
index 6ae2fc8233ff9cabdabb3adb44ecd2585dca2db4..02a218fbde5f405d3fde24610694214a3def088b 100644 (file)
@@ -64,7 +64,7 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
                goto done;
 
        /* Update the expiry counter if fs is busy */
-       if (may_umount_tree(mnt)) {
+       if (!may_umount_tree(mnt)) {
                struct autofs_info *ino = autofs4_dentry_ino(top);
                ino->last_used = jiffies;
                goto done;
index dcd4802a5d5fb1b1e8c3ab9e9750c8aa544ac3d6..26eb1f0248667598d79cb126df83098ab9deefac 100644 (file)
@@ -699,7 +699,7 @@ static inline int autofs4_ask_umount(struct vfsmount *mnt, int __user *p)
 {
        int status = 0;
 
-       if (may_umount(mnt) == 0)
+       if (may_umount(mnt))
                status = 1;
 
        DPRINTK("returning %d", status);
index e069a4c5e389c48eb88e3a6847422750ae693b2b..bf478addb852b70c1ec036e33100f93031c5dc6b 100644 (file)
@@ -459,9 +459,9 @@ int may_umount_tree(struct vfsmount *mnt)
        spin_unlock(&vfsmount_lock);
 
        if (actual_refs > minimum_refs)
-               return -EBUSY;
+               return 0;
 
-       return 0;
+       return 1;
 }
 
 EXPORT_SYMBOL(may_umount_tree);
@@ -481,10 +481,10 @@ EXPORT_SYMBOL(may_umount_tree);
  */
 int may_umount(struct vfsmount *mnt)
 {
-       int ret = 0;
+       int ret = 1;
        spin_lock(&vfsmount_lock);
        if (propagate_mount_busy(mnt, 2))
-               ret = -EBUSY;
+               ret = 0;
        spin_unlock(&vfsmount_lock);
        return ret;
 }