]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ext2/balloc.c
fs/ext2: use BUG_ON
[linux-2.6-omap-h63xx.git] / fs / ext2 / balloc.c
index a51bdf82450f994bc87861a58a47dcc069b40852..c834f512dce5fc21026a2345ca6366d3092c2e77 100644 (file)
@@ -245,8 +245,7 @@ restart:
                prev = rsv;
        }
        printk("Window map complete.\n");
-       if (bad)
-               BUG();
+       BUG_ON(bad);
 }
 #define rsv_window_dump(root, verbose) \
        __rsv_window_dump((root), (verbose), __FUNCTION__)
@@ -1315,8 +1314,8 @@ retry_alloc:
        smp_rmb();
 
        /*
-        * Now search the rest of the groups.  We assume that 
-        * i and gdp correctly point to the last group visited.
+        * Now search the rest of the groups.  We assume that
+        * group_no and gdp correctly point to the last group visited.
         */
        for (bgi = 0; bgi < ngroups; bgi++) {
                group_no++;
@@ -1533,9 +1532,6 @@ int ext2_bg_has_super(struct super_block *sb, int group)
  */
 unsigned long ext2_bg_num_gdb(struct super_block *sb, int group)
 {
-       if (EXT2_HAS_RO_COMPAT_FEATURE(sb,EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)&&
-           !ext2_group_sparse(group))
-               return 0;
-       return EXT2_SB(sb)->s_gdb_count;
+       return ext2_bg_has_super(sb, group) ? EXT2_SB(sb)->s_gdb_count : 0;
 }