From 763be0e14d720860fe3232c7b7ee2e691e4dbac2 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 27 Feb 2013 22:51:08 -0500 Subject: [PATCH] --- yaml --- r: 360715 b: refs/heads/master c: c4d30967f3020cda9df9ee22af79cd1f2c284244 h: refs/heads/master i: 360713: 64327bf6bce22614d64a20c83c2bc18008434ac3 360711: 57a7483440187e43bc4b7647c5474bc38ffb5ee2 v: v3 --- [refs] | 2 +- trunk/fs/9p/fid.c | 7 ++++--- trunk/fs/9p/fid.h | 2 +- trunk/fs/9p/vfs_dentry.c | 9 +++------ trunk/include/net/9p/client.h | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index 6cab75f0dbb3..f1666f386169 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 634095dab2a2001844fc8b26673c0cb14a766cdf +refs/heads/master: c4d30967f3020cda9df9ee22af79cd1f2c284244 diff --git a/trunk/fs/9p/fid.c b/trunk/fs/9p/fid.c index 71bc36a03e72..49de4264db9a 100644 --- a/trunk/fs/9p/fid.c +++ b/trunk/fs/9p/fid.c @@ -54,12 +54,12 @@ int v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid) if (!dent) return -ENOMEM; - INIT_LIST_HEAD(&dent->fidlist); + INIT_HLIST_HEAD(&dent->fidlist); dentry->d_fsdata = dent; } spin_lock(&dentry->d_lock); - list_add(&fid->dlist, &dent->fidlist); + hlist_add_head(&fid->dlist, &dent->fidlist); spin_unlock(&dentry->d_lock); return 0; @@ -84,8 +84,9 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, kuid_t uid, int any) dent = (struct v9fs_dentry *) dentry->d_fsdata; ret = NULL; if (dent) { + struct hlist_node *n; spin_lock(&dentry->d_lock); - list_for_each_entry(fid, &dent->fidlist, dlist) { + hlist_for_each_entry(fid, n, &dent->fidlist, dlist) { if (any || uid_eq(fid->uid, uid)) { ret = fid; break; diff --git a/trunk/fs/9p/fid.h b/trunk/fs/9p/fid.h index 469b5d517694..86eeb34ce46f 100644 --- a/trunk/fs/9p/fid.h +++ b/trunk/fs/9p/fid.h @@ -40,7 +40,7 @@ * Design and Implementation of the Linux 9P File System documentation */ struct v9fs_dentry { - struct list_head fidlist; + struct hlist_head fidlist; }; struct p9_fid *v9fs_fid_lookup(struct dentry *dentry); diff --git a/trunk/fs/9p/vfs_dentry.c b/trunk/fs/9p/vfs_dentry.c index 9ad68628522c..fcd49833ef80 100644 --- a/trunk/fs/9p/vfs_dentry.c +++ b/trunk/fs/9p/vfs_dentry.c @@ -84,16 +84,13 @@ static int v9fs_cached_dentry_delete(const struct dentry *dentry) static void v9fs_dentry_release(struct dentry *dentry) { struct v9fs_dentry *dent; - struct p9_fid *temp, *current_fid; - p9_debug(P9_DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_name.name, dentry); dent = dentry->d_fsdata; if (dent) { - list_for_each_entry_safe(current_fid, temp, &dent->fidlist, - dlist) { - p9_client_clunk(current_fid); - } + struct hlist_node *p, *n; + hlist_for_each_safe(p, n, &dent->fidlist) + p9_client_clunk(hlist_entry(p, struct p9_fid, dlist)); kfree(dent); dentry->d_fsdata = NULL; diff --git a/trunk/include/net/9p/client.h b/trunk/include/net/9p/client.h index 5ff70f433e87..4c7c01a73911 100644 --- a/trunk/include/net/9p/client.h +++ b/trunk/include/net/9p/client.h @@ -192,7 +192,7 @@ struct p9_fid { void *rdir; struct list_head flist; - struct list_head dlist; /* list of all fids attached to a dentry */ + struct hlist_node dlist; /* list of all fids attached to a dentry */ }; /**