Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101969
b: refs/heads/master
c: bd9bb45
h: refs/heads/master
i:
  101967: 6e75f09
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Jul 15, 2008
1 parent f7c8ca2 commit 7c77e5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fc0f684c21b5d4b41dc2ec76f7c0897ac98f5b6e
refs/heads/master: bd9bb454b76fb6ca2d00f17313f9f9df5f5c404a
9 changes: 3 additions & 6 deletions trunk/fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,14 +1297,12 @@ static int nfs_rmdir(struct inode *dir, struct dentry *dentry)
dfprintk(VFS, "NFS: rmdir(%s/%ld), %s\n",
dir->i_sb->s_id, dir->i_ino, dentry->d_name.name);

lock_kernel();
error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name);
/* Ensure the VFS deletes this inode */
if (error == 0 && dentry->d_inode != NULL)
clear_nlink(dentry->d_inode);
else if (error == -ENOENT)
nfs_dentry_handle_enoent(dentry);
unlock_kernel();

return error;
}
Expand Down Expand Up @@ -1429,14 +1427,14 @@ static int nfs_unlink(struct inode *dir, struct dentry *dentry)
dfprintk(VFS, "NFS: unlink(%s/%ld, %s)\n", dir->i_sb->s_id,
dir->i_ino, dentry->d_name.name);

lock_kernel();
spin_lock(&dcache_lock);
spin_lock(&dentry->d_lock);
if (atomic_read(&dentry->d_count) > 1) {
spin_unlock(&dentry->d_lock);
spin_unlock(&dcache_lock);
/* Start asynchronous writeout of the inode */
write_inode_now(dentry->d_inode, 0);
lock_kernel();
error = nfs_sillyrename(dir, dentry);
unlock_kernel();
return error;
Expand All @@ -1452,7 +1450,6 @@ static int nfs_unlink(struct inode *dir, struct dentry *dentry)
nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
} else if (need_rehash)
d_rehash(dentry);
unlock_kernel();
return error;
}

Expand Down Expand Up @@ -1587,7 +1584,6 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
* To prevent any new references to the target during the rename,
* we unhash the dentry and free the inode in advance.
*/
lock_kernel();
if (!d_unhashed(new_dentry)) {
d_drop(new_dentry);
rehash = new_dentry;
Expand Down Expand Up @@ -1621,7 +1617,9 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
goto out;

/* silly-rename the existing target ... */
lock_kernel();
err = nfs_sillyrename(new_dir, new_dentry);
unlock_kernel();
if (!err) {
new_dentry = rehash = dentry;
new_inode = NULL;
Expand Down Expand Up @@ -1665,7 +1663,6 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
/* new dentry created? */
if (dentry)
dput(dentry);
unlock_kernel();
return error;
}

Expand Down

0 comments on commit 7c77e5b

Please sign in to comment.