Commit 912dbc15 authored by Sage Weil's avatar Sage Weil Committed by Al Viro

vfs: clean up vfs_rmdir

Simplify the control flow with an out label.
Signed-off-by: default avatarSage Weil <sage@newdream.net>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent b5afd2c4
...@@ -2563,23 +2563,26 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry) ...@@ -2563,23 +2563,26 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry)
return -EPERM; return -EPERM;
mutex_lock(&dentry->d_inode->i_mutex); mutex_lock(&dentry->d_inode->i_mutex);
error = -EBUSY;
if (d_mountpoint(dentry)) if (d_mountpoint(dentry))
error = -EBUSY; goto out;
else {
error = security_inode_rmdir(dir, dentry); error = security_inode_rmdir(dir, dentry);
if (!error) { if (error)
error = dir->i_op->rmdir(dir, dentry); goto out;
if (!error) {
dentry->d_inode->i_flags |= S_DEAD; error = dir->i_op->rmdir(dir, dentry);
dont_mount(dentry); if (error)
} goto out;
}
} dentry->d_inode->i_flags |= S_DEAD;
dont_mount(dentry);
out:
mutex_unlock(&dentry->d_inode->i_mutex); mutex_unlock(&dentry->d_inode->i_mutex);
if (!error) { if (!error)
d_delete(dentry); d_delete(dentry);
}
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment