[PATCH] Remove hlist_for_each_rcu() API, convert existing use to hlist_for_each_entry_rcu

Remove the hlist_for_each_rcu() API, which is used only in one place, and
is trivially converted to hlist_for_each_entry_rcu(), making the code
shorter and more readable.  Any out-of-tree uses may be similarly
converted.

Signed-off-by: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Paul E. McKenney
2005-11-07 00:59:17 -08:00
committed by Linus Torvalds
parent 9f46080c41
commit 665a7583f3
3 changed files with 8 additions and 17 deletions

View File

@@ -644,7 +644,7 @@ void shrink_dcache_parent(struct dentry * parent)
*
* Prune the dentries that are anonymous
*
* parsing d_hash list does not hlist_for_each_rcu() as it
* parsing d_hash list does not hlist_for_each_entry_rcu() as it
* done under dcache_lock.
*
*/
@@ -1043,15 +1043,13 @@ struct dentry * __d_lookup(struct dentry * parent, struct qstr * name)
struct hlist_head *head = d_hash(parent,hash);
struct dentry *found = NULL;
struct hlist_node *node;
struct dentry *dentry;
rcu_read_lock();
hlist_for_each_rcu(node, head) {
struct dentry *dentry;
hlist_for_each_entry_rcu(dentry, node, head, d_hash) {
struct qstr *qstr;
dentry = hlist_entry(node, struct dentry, d_hash);
if (dentry->d_name.hash != hash)
continue;
if (dentry->d_parent != parent)
@@ -1123,7 +1121,7 @@ int d_validate(struct dentry *dentry, struct dentry *dparent)
spin_lock(&dcache_lock);
base = d_hash(dparent, dentry->d_name.hash);
hlist_for_each(lhp,base) {
/* hlist_for_each_rcu() not required for d_hash list
/* hlist_for_each_entry_rcu() not required for d_hash list
* as it is parsed under dcache_lock
*/
if (dentry == hlist_entry(lhp, struct dentry, d_hash)) {