aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/fid.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/9p/fid.c')
-rw-r--r--fs/9p/fid.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/9p/fid.c b/fs/9p/fid.c
index afd4724b2d92..71bc36a03e72 100644
--- a/fs/9p/fid.c
+++ b/fs/9p/fid.c
@@ -54,14 +54,13 @@ int v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid)
54 if (!dent) 54 if (!dent)
55 return -ENOMEM; 55 return -ENOMEM;
56 56
57 spin_lock_init(&dent->lock);
58 INIT_LIST_HEAD(&dent->fidlist); 57 INIT_LIST_HEAD(&dent->fidlist);
59 dentry->d_fsdata = dent; 58 dentry->d_fsdata = dent;
60 } 59 }
61 60
62 spin_lock(&dent->lock); 61 spin_lock(&dentry->d_lock);
63 list_add(&fid->dlist, &dent->fidlist); 62 list_add(&fid->dlist, &dent->fidlist);
64 spin_unlock(&dent->lock); 63 spin_unlock(&dentry->d_lock);
65 64
66 return 0; 65 return 0;
67} 66}
@@ -85,14 +84,14 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, kuid_t uid, int any)
85 dent = (struct v9fs_dentry *) dentry->d_fsdata; 84 dent = (struct v9fs_dentry *) dentry->d_fsdata;
86 ret = NULL; 85 ret = NULL;
87 if (dent) { 86 if (dent) {
88 spin_lock(&dent->lock); 87 spin_lock(&dentry->d_lock);
89 list_for_each_entry(fid, &dent->fidlist, dlist) { 88 list_for_each_entry(fid, &dent->fidlist, dlist) {
90 if (any || uid_eq(fid->uid, uid)) { 89 if (any || uid_eq(fid->uid, uid)) {
91 ret = fid; 90 ret = fid;
92 break; 91 break;
93 } 92 }
94 } 93 }
95 spin_unlock(&dent->lock); 94 spin_unlock(&dentry->d_lock);
96 } 95 }
97 96
98 return ret; 97 return ret;