mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
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: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
b70c394099
commit
d473012710
1 changed files with 11 additions and 11 deletions
22
fs/super.c
22
fs/super.c
|
@ -332,21 +332,21 @@ struct super_block *sget(struct file_system_type *type,
|
|||
void *data)
|
||||
{
|
||||
struct super_block *s = NULL;
|
||||
struct list_head *p;
|
||||
struct super_block *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(old, data))
|
||||
continue;
|
||||
if (!grab_super(old))
|
||||
goto retry;
|
||||
if (s)
|
||||
destroy_super(s);
|
||||
return old;
|
||||
if (test) {
|
||||
list_for_each_entry(old, &type->fs_supers, s_instances) {
|
||||
if (!test(old, data))
|
||||
continue;
|
||||
if (!grab_super(old))
|
||||
goto retry;
|
||||
if (s)
|
||||
destroy_super(s);
|
||||
return old;
|
||||
}
|
||||
}
|
||||
if (!s) {
|
||||
spin_unlock(&sb_lock);
|
||||
|
|
Loading…
Reference in a new issue