get rid of open-coded grab_super() in get_active_super()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 22 Mar 2010 02:34:11 +0000 (22:34 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 21 May 2010 22:31:14 +0000 (18:31 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/super.c

index 156eae5ed5030fac4b94d1e999bb05bc6acbb07e..d8c8b1d2d010097ff389a02f9b4271df50678020 100644 (file)
@@ -487,22 +487,9 @@ struct super_block *get_active_super(struct block_device *bdev)
                if (sb->s_bdev != bdev)
                        continue;
 
-               sb->s_count++;
-               spin_unlock(&sb_lock);
-               down_write(&sb->s_umount);
-               if (sb->s_root) {
-                       spin_lock(&sb_lock);
-                       if (sb->s_count > S_BIAS) {
-                               atomic_inc(&sb->s_active);
-                               sb->s_count--;
-                               spin_unlock(&sb_lock);
-                               return sb;
-                       }
-                       spin_unlock(&sb_lock);
-               }
-               up_write(&sb->s_umount);
-               put_super(sb);
-               yield();
+               if (grab_super(sb)) /* drops sb_lock */
+                       return sb;
+
                spin_lock(&sb_lock);
        }
        spin_unlock(&sb_lock);