diff mbox

fs/dcache: use standard list macro for d_find_alias

Message ID 20101217175355.GA11515@fieldses.org
State RFC, archived
Headers show

Commit Message

J. Bruce Fields Dec. 17, 2010, 5:53 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/dcache.c b/fs/dcache.c
index 23702a9..5ed93cd 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -358,16 +358,9 @@  EXPORT_SYMBOL(dget_locked);
 
 static struct dentry * __d_find_alias(struct inode *inode, int want_discon)
 {
-	struct list_head *head, *next, *tmp;
 	struct dentry *alias, *discon_alias=NULL;
 
-	head = &inode->i_dentry;
-	next = inode->i_dentry.next;
-	while (next != head) {
-		tmp = next;
-		next = tmp->next;
-		prefetch(next);
-		alias = list_entry(tmp, struct dentry, d_alias);
+	list_for_each_entry(alias, &inode->i_dentry, d_alias) {
  		if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) {
 			if (IS_ROOT(alias) &&
 			    (alias->d_flags & DCACHE_DISCONNECTED))