Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257402
b: refs/heads/master
c: 4513d89
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jul 21, 2011
1 parent 4d156cc commit 4e32e63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 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: 6c673ab393bc18e8bff729cd04cf384d15e72a04
refs/heads/master: 4513d899c418ff69052420e29e354e4c64b3ef76
24 changes: 5 additions & 19 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1652,26 +1652,12 @@ struct dentry *d_add_ci(struct dentry *dentry, struct inode *inode,
* Negative dentry: instantiate it unless the inode is a directory and
* already has a dentry.
*/
spin_lock(&inode->i_lock);
if (!S_ISDIR(inode->i_mode) || list_empty(&inode->i_dentry)) {
__d_instantiate(found, inode);
spin_unlock(&inode->i_lock);
security_d_instantiate(found, inode);
return found;
new = d_splice_alias(inode, found);
if (new) {
dput(found);
found = new;
}

/*
* In case a directory already has a (disconnected) entry grab a
* reference to it, move it in place and use it.
*/
new = list_entry(inode->i_dentry.next, struct dentry, d_alias);
__dget(new);
spin_unlock(&inode->i_lock);
security_d_instantiate(found, inode);
d_move(new, found);
iput(inode);
dput(found);
return new;
return found;

err_out:
iput(inode);
Expand Down

0 comments on commit 4e32e63

Please sign in to comment.