aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@us.ibm.com>2005-11-07 03:59:17 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:53:35 -0500
commit665a7583f32ab5b3bfe7a4d88da506542f7cdd75 (patch)
tree2b45def3f7ecaf322b05622a635510fe8aef51af /fs/dcache.c
parent9f46080c41d5f3f7c00b4e169ba4b0b2865258bf (diff)
[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>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index e90512ed35a4..17e439138681 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -644,7 +644,7 @@ void shrink_dcache_parent(struct dentry * parent)
644 * 644 *
645 * Prune the dentries that are anonymous 645 * Prune the dentries that are anonymous
646 * 646 *
647 * parsing d_hash list does not hlist_for_each_rcu() as it 647 * parsing d_hash list does not hlist_for_each_entry_rcu() as it
648 * done under dcache_lock. 648 * done under dcache_lock.
649 * 649 *
650 */ 650 */
@@ -1043,15 +1043,13 @@ struct dentry * __d_lookup(struct dentry * parent, struct qstr * name)
1043 struct hlist_head *head = d_hash(parent,hash); 1043 struct hlist_head *head = d_hash(parent,hash);
1044 struct dentry *found = NULL; 1044 struct dentry *found = NULL;
1045 struct hlist_node *node; 1045 struct hlist_node *node;
1046 struct dentry *dentry;
1046 1047
1047 rcu_read_lock(); 1048 rcu_read_lock();
1048 1049
1049 hlist_for_each_rcu(node, head) { 1050 hlist_for_each_entry_rcu(dentry, node, head, d_hash) {
1050 struct dentry *dentry;
1051 struct qstr *qstr; 1051 struct qstr *qstr;
1052 1052
1053 dentry = hlist_entry(node, struct dentry, d_hash);
1054
1055 if (dentry->d_name.hash != hash) 1053 if (dentry->d_name.hash != hash)
1056 continue; 1054 continue;
1057 if (dentry->d_parent != parent) 1055 if (dentry->d_parent != parent)
@@ -1123,7 +1121,7 @@ int d_validate(struct dentry *dentry, struct dentry *dparent)
1123 spin_lock(&dcache_lock); 1121 spin_lock(&dcache_lock);
1124 base = d_hash(dparent, dentry->d_name.hash); 1122 base = d_hash(dparent, dentry->d_name.hash);
1125 hlist_for_each(lhp,base) { 1123 hlist_for_each(lhp,base) {
1126 /* hlist_for_each_rcu() not required for d_hash list 1124 /* hlist_for_each_entry_rcu() not required for d_hash list
1127 * as it is parsed under dcache_lock 1125 * as it is parsed under dcache_lock
1128 */ 1126 */
1129 if (dentry == hlist_entry(lhp, struct dentry, d_hash)) { 1127 if (dentry == hlist_entry(lhp, struct dentry, d_hash)) {