diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-27 22:51:08 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-27 22:51:08 -0500 |
commit | c4d30967f3020cda9df9ee22af79cd1f2c284244 (patch) | |
tree | 744565daf8f1d711c0186c3261ebf42eebe1a44e /fs | |
parent | 634095dab2a2001844fc8b26673c0cb14a766cdf (diff) |
9p: turn fid->dlist into hlist
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/9p/fid.c | 7 | ||||
-rw-r--r-- | fs/9p/fid.h | 2 | ||||
-rw-r--r-- | fs/9p/vfs_dentry.c | 9 |
3 files changed, 8 insertions, 10 deletions
diff --git a/fs/9p/fid.c b/fs/9p/fid.c index 71bc36a03e72..49de4264db9a 100644 --- a/fs/9p/fid.c +++ b/fs/9p/fid.c | |||
@@ -54,12 +54,12 @@ 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 | INIT_LIST_HEAD(&dent->fidlist); | 57 | INIT_HLIST_HEAD(&dent->fidlist); |
58 | dentry->d_fsdata = dent; | 58 | dentry->d_fsdata = dent; |
59 | } | 59 | } |
60 | 60 | ||
61 | spin_lock(&dentry->d_lock); | 61 | spin_lock(&dentry->d_lock); |
62 | list_add(&fid->dlist, &dent->fidlist); | 62 | hlist_add_head(&fid->dlist, &dent->fidlist); |
63 | spin_unlock(&dentry->d_lock); | 63 | spin_unlock(&dentry->d_lock); |
64 | 64 | ||
65 | return 0; | 65 | return 0; |
@@ -84,8 +84,9 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, kuid_t uid, int any) | |||
84 | dent = (struct v9fs_dentry *) dentry->d_fsdata; | 84 | dent = (struct v9fs_dentry *) dentry->d_fsdata; |
85 | ret = NULL; | 85 | ret = NULL; |
86 | if (dent) { | 86 | if (dent) { |
87 | struct hlist_node *n; | ||
87 | spin_lock(&dentry->d_lock); | 88 | spin_lock(&dentry->d_lock); |
88 | list_for_each_entry(fid, &dent->fidlist, dlist) { | 89 | hlist_for_each_entry(fid, n, &dent->fidlist, dlist) { |
89 | if (any || uid_eq(fid->uid, uid)) { | 90 | if (any || uid_eq(fid->uid, uid)) { |
90 | ret = fid; | 91 | ret = fid; |
91 | break; | 92 | break; |
diff --git a/fs/9p/fid.h b/fs/9p/fid.h index 469b5d517694..86eeb34ce46f 100644 --- a/fs/9p/fid.h +++ b/fs/9p/fid.h | |||
@@ -40,7 +40,7 @@ | |||
40 | * Design and Implementation of the Linux 9P File System documentation | 40 | * Design and Implementation of the Linux 9P File System documentation |
41 | */ | 41 | */ |
42 | struct v9fs_dentry { | 42 | struct v9fs_dentry { |
43 | struct list_head fidlist; | 43 | struct hlist_head fidlist; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | struct p9_fid *v9fs_fid_lookup(struct dentry *dentry); | 46 | struct p9_fid *v9fs_fid_lookup(struct dentry *dentry); |
diff --git a/fs/9p/vfs_dentry.c b/fs/9p/vfs_dentry.c index 9ad68628522c..fcd49833ef80 100644 --- a/fs/9p/vfs_dentry.c +++ b/fs/9p/vfs_dentry.c | |||
@@ -84,16 +84,13 @@ static int v9fs_cached_dentry_delete(const struct dentry *dentry) | |||
84 | static void v9fs_dentry_release(struct dentry *dentry) | 84 | static void v9fs_dentry_release(struct dentry *dentry) |
85 | { | 85 | { |
86 | struct v9fs_dentry *dent; | 86 | struct v9fs_dentry *dent; |
87 | struct p9_fid *temp, *current_fid; | ||
88 | |||
89 | p9_debug(P9_DEBUG_VFS, " dentry: %s (%p)\n", | 87 | p9_debug(P9_DEBUG_VFS, " dentry: %s (%p)\n", |
90 | dentry->d_name.name, dentry); | 88 | dentry->d_name.name, dentry); |
91 | dent = dentry->d_fsdata; | 89 | dent = dentry->d_fsdata; |
92 | if (dent) { | 90 | if (dent) { |
93 | list_for_each_entry_safe(current_fid, temp, &dent->fidlist, | 91 | struct hlist_node *p, *n; |
94 | dlist) { | 92 | hlist_for_each_safe(p, n, &dent->fidlist) |
95 | p9_client_clunk(current_fid); | 93 | p9_client_clunk(hlist_entry(p, struct p9_fid, dlist)); |
96 | } | ||
97 | 94 | ||
98 | kfree(dent); | 95 | kfree(dent); |
99 | dentry->d_fsdata = NULL; | 96 | dentry->d_fsdata = NULL; |