Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226714
b: refs/heads/master
c: 357f8e6
h: refs/heads/master
v: v3
  • Loading branch information
Nick Piggin committed Jan 7, 2011
1 parent 051b47a commit 70f8561
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 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: 89ad485f01fd83c47f17a128db3bd7b89c0f244f
refs/heads/master: 357f8e658bba8a085c4a5d4331e30894be8096b8
24 changes: 12 additions & 12 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1828,10 +1828,15 @@ void d_delete(struct dentry * dentry)
/*
* Are we the only user?
*/
spin_lock(&dcache_inode_lock);
again:
spin_lock(&dentry->d_lock);
isdir = S_ISDIR(dentry->d_inode->i_mode);
if (dentry->d_count == 1) {
if (!spin_trylock(&dcache_inode_lock)) {
spin_unlock(&dentry->d_lock);
cpu_relax();
goto again;
}
dentry->d_flags &= ~DCACHE_CANT_MOUNT;
dentry_iput(dentry);
fsnotify_nameremove(dentry, isdir);
Expand All @@ -1842,7 +1847,6 @@ void d_delete(struct dentry * dentry)
__d_drop(dentry);

spin_unlock(&dentry->d_lock);
spin_unlock(&dcache_inode_lock);

fsnotify_nameremove(dentry, isdir);
}
Expand Down Expand Up @@ -2164,14 +2168,15 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)

BUG_ON(!d_unhashed(dentry));

spin_lock(&dcache_inode_lock);

if (!inode) {
actual = dentry;
__d_instantiate(dentry, NULL);
goto found_lock;
d_rehash(actual);
goto out_nolock;
}

spin_lock(&dcache_inode_lock);

if (S_ISDIR(inode->i_mode)) {
struct dentry *alias;

Expand All @@ -2198,10 +2203,9 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
actual = __d_instantiate_unique(dentry, inode);
if (!actual)
actual = dentry;
else if (unlikely(!d_unhashed(actual)))
goto shouldnt_be_hashed;
else
BUG_ON(!d_unhashed(actual));

found_lock:
spin_lock(&actual->d_lock);
found:
spin_lock(&dcache_hash_lock);
Expand All @@ -2217,10 +2221,6 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)

iput(inode);
return actual;

shouldnt_be_hashed:
spin_unlock(&dcache_inode_lock);
BUG();
}
EXPORT_SYMBOL_GPL(d_materialise_unique);

Expand Down

0 comments on commit 70f8561

Please sign in to comment.