提交 e3474a8e 编写于 作者: I Ian Kent 提交者: Linus Torvalds

[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: NIan Kent <raven@themaw.net>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 90a59c7c
...@@ -92,7 +92,7 @@ struct autofs_dir_ent *autofs_expire(struct super_block *sb, ...@@ -92,7 +92,7 @@ struct autofs_dir_ent *autofs_expire(struct super_block *sb,
; ;
dput(dentry); dput(dentry);
if ( may_umount(mnt) == 0 ) { if ( may_umount(mnt) ) {
mntput(mnt); mntput(mnt);
DPRINTK(("autofs: signaling expire on %s\n", ent->name)); DPRINTK(("autofs: signaling expire on %s\n", ent->name));
return ent; /* Expirable! */ return ent; /* Expirable! */
......
...@@ -64,7 +64,7 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry) ...@@ -64,7 +64,7 @@ static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry)
goto done; goto done;
/* Update the expiry counter if fs is busy */ /* 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); struct autofs_info *ino = autofs4_dentry_ino(top);
ino->last_used = jiffies; ino->last_used = jiffies;
goto done; goto done;
......
...@@ -699,7 +699,7 @@ static inline int autofs4_ask_umount(struct vfsmount *mnt, int __user *p) ...@@ -699,7 +699,7 @@ static inline int autofs4_ask_umount(struct vfsmount *mnt, int __user *p)
{ {
int status = 0; int status = 0;
if (may_umount(mnt) == 0) if (may_umount(mnt))
status = 1; status = 1;
DPRINTK("returning %d", status); DPRINTK("returning %d", status);
......
...@@ -459,9 +459,9 @@ int may_umount_tree(struct vfsmount *mnt) ...@@ -459,9 +459,9 @@ int may_umount_tree(struct vfsmount *mnt)
spin_unlock(&vfsmount_lock); spin_unlock(&vfsmount_lock);
if (actual_refs > minimum_refs) if (actual_refs > minimum_refs)
return -EBUSY; return 0;
return 0; return 1;
} }
EXPORT_SYMBOL(may_umount_tree); EXPORT_SYMBOL(may_umount_tree);
...@@ -481,10 +481,10 @@ EXPORT_SYMBOL(may_umount_tree); ...@@ -481,10 +481,10 @@ EXPORT_SYMBOL(may_umount_tree);
*/ */
int may_umount(struct vfsmount *mnt) int may_umount(struct vfsmount *mnt)
{ {
int ret = 0; int ret = 1;
spin_lock(&vfsmount_lock); spin_lock(&vfsmount_lock);
if (propagate_mount_busy(mnt, 2)) if (propagate_mount_busy(mnt, 2))
ret = -EBUSY; ret = 0;
spin_unlock(&vfsmount_lock); spin_unlock(&vfsmount_lock);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册