From: Al Viro Date: Mon, 22 Mar 2010 02:34:11 +0000 (-0400) Subject: get rid of open-coded grab_super() in get_active_super() X-Git-Tag: v3.0~4890^2~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=389b8be6ef419397e4f176652927ebad6ebb4b77;p=platform%2Fkernel%2Flinux-amlogic.git get rid of open-coded grab_super() in get_active_super() Signed-off-by: Al Viro --- diff --git a/fs/super.c b/fs/super.c index 156eae5..d8c8b1d 100644 --- a/fs/super.c +++ b/fs/super.c @@ -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);