提交 912dbc15 编写于 作者: S Sage Weil 提交者: Al Viro

vfs: clean up vfs_rmdir

Simplify the control flow with an out label.
Signed-off-by: NSage Weil <sage@newdream.net>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 b5afd2c4
......@@ -2563,23 +2563,26 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry)
return -EPERM;
mutex_lock(&dentry->d_inode->i_mutex);
if (d_mountpoint(dentry))
error = -EBUSY;
else {
if (d_mountpoint(dentry))
goto out;
error = security_inode_rmdir(dir, dentry);
if (!error) {
if (error)
goto out;
error = dir->i_op->rmdir(dir, dentry);
if (!error) {
if (error)
goto out;
dentry->d_inode->i_flags |= S_DEAD;
dont_mount(dentry);
}
}
}
out:
mutex_unlock(&dentry->d_inode->i_mutex);
if (!error) {
if (!error)
d_delete(dentry);
}
return error;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册