Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360721
b: refs/heads/master
c: 5e60867
h: refs/heads/master
i:
  360719: 1635e16
v: v3
  • Loading branch information
Al Viro committed Feb 28, 2013
1 parent 9083c59 commit de9a95c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 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: a3b2157e72e321fa313389ac744bbf6d6cb6986d
refs/heads/master: 5e608671dfbfd6a9556c31df65a4f147439eed59
20 changes: 17 additions & 3 deletions trunk/fs/9p/fid.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,15 @@
*
*/

static inline void __add_fid(struct dentry *dentry, struct p9_fid *fid)
{
hlist_add_head(&fid->dlist, (struct hlist_head *)&dentry->d_fsdata);
}

void v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid)
{
spin_lock(&dentry->d_lock);
hlist_add_head(&fid->dlist, (struct hlist_head *)&dentry->d_fsdata);
__add_fid(dentry, fid);
spin_unlock(&dentry->d_lock);
}

Expand Down Expand Up @@ -198,8 +203,17 @@ static struct p9_fid *v9fs_fid_lookup_with_uid(struct dentry *dentry,
}
kfree(wnames);
fid_out:
if (!IS_ERR(fid))
v9fs_fid_add(dentry, fid);
if (!IS_ERR(fid)) {
spin_lock(&dentry->d_lock);
if (d_unhashed(dentry)) {
spin_unlock(&dentry->d_lock);
p9_client_clunk(fid);
fid = ERR_PTR(-ENOENT);
} else {
__add_fid(dentry, fid);
spin_unlock(&dentry->d_lock);
}
}
err_out:
up_read(&v9ses->rename_sem);
return fid;
Expand Down

0 comments on commit de9a95c

Please sign in to comment.