Skip to contentSkip to conversation

vfs: use list_for_each_entry instead

PATCH New Denis Cheng 1 participant 1 message Aug 16, 2007 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfs: use list_for_each_entry instead

---
 fs/super.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
fs/super.c +2 -5
index fc8ebed..f287c15 100644
@@ -334,15 +334,12 @@ struct super_block *sget(struct file_system_type *type,
 			int (*set)(struct super_block *,void *),
 			void *data)
 {
-	struct super_block *s = NULL;
-	struct list_head *p;
+	struct super_block *s = NULL, *old;
 	int err;
 
 retry:
 	spin_lock(&sb_lock);
-	if (test) list_for_each(p, &type->fs_supers) {
-		struct super_block *old;
-		old = list_entry(p, struct super_block, s_instances);
+	if (test) list_for_each_entry(old, &type->fs_supers, s_instances) {
 		if (!test(old, data))
 			continue;
 		if (!grab_super(old))
Signature · 1 line
1.5.3.rc4