Commit 3643f1c8 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] IS_DEADDIR checks (2.5)

	2.4 variant will go to Marcelo in a couple of minutes.

Patch moves IS_DEADDIR() checks into may_delete().
parent e913fd70
......@@ -881,6 +881,8 @@ static inline int may_delete(struct inode *dir,struct dentry *victim, int isdir)
return -EBUSY;
} else if (S_ISDIR(victim->d_inode->i_mode))
return -EISDIR;
if (IS_DEADDIR(dir))
return -ENOENT;
return 0;
}
......@@ -1390,9 +1392,7 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry)
down(&dentry->d_inode->i_sem);
d_unhash(dentry);
if (IS_DEADDIR(dir))
error = -ENOENT;
else if (d_mountpoint(dentry))
if (d_mountpoint(dentry))
error = -EBUSY;
else {
error = dir->i_op->rmdir(dir, dentry);
......@@ -1776,8 +1776,6 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
if (!old_dir->i_op || !old_dir->i_op->rename)
return -EPERM;
if (IS_DEADDIR(old_dir)||IS_DEADDIR(new_dir))
return -ENOENT;
DQUOT_INIT(old_dir);
DQUOT_INIT(new_dir);
......
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