提交 d4730127 编写于 作者: M Matthias Kaehlcke 提交者: Linus Torvalds

fs/super.c: use list_for_each_entry() instead of list_for_each()

fs/super.c: use list_for_each_entry() instead of list_for_each() in
sget()

[akpm@linux-foundation.org: clean up some crap while we're there]
Signed-off-by: NMatthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 b70c3940
...@@ -332,21 +332,21 @@ struct super_block *sget(struct file_system_type *type, ...@@ -332,21 +332,21 @@ struct super_block *sget(struct file_system_type *type,
void *data) void *data)
{ {
struct super_block *s = NULL; struct super_block *s = NULL;
struct list_head *p; struct super_block *old;
int err; int err;
retry: retry:
spin_lock(&sb_lock); spin_lock(&sb_lock);
if (test) list_for_each(p, &type->fs_supers) { if (test) {
struct super_block *old; list_for_each_entry(old, &type->fs_supers, s_instances) {
old = list_entry(p, struct super_block, s_instances); if (!test(old, data))
if (!test(old, data)) continue;
continue; if (!grab_super(old))
if (!grab_super(old)) goto retry;
goto retry; if (s)
if (s) destroy_super(s);
destroy_super(s); return old;
return old; }
} }
if (!s) { if (!s) {
spin_unlock(&sb_lock); spin_unlock(&sb_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册