Transfer responsibility of setting the *_UNINIT flags to libext2fs

Mke2fs used to have special case, ugly code in
setup_lazy_bg/setup_uninit_bg flag which set the flags based on all
sorts of special cases.  Change it so that it is done in libext2fs,
and fix mke2fs to use alloc_stats functions which will take care of
clearing the *_UNINIT flags automatically as needed.

This is preparatory work to make the flex_bg allocation patch much
cleaner.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/lib/ext2fs/alloc_stats.c b/lib/ext2fs/alloc_stats.c
index 725f28d..3956528 100644
--- a/lib/ext2fs/alloc_stats.c
+++ b/lib/ext2fs/alloc_stats.c
@@ -28,10 +28,9 @@
 	if (isdir)
 		fs->group_desc[group].bg_used_dirs_count += inuse;
 
-	/* We don't strictly need to be clearing these if inuse < 0
+	/* We don't strictly need to be clearing the uninit flag if inuse < 0
 	 * (i.e. freeing inodes) but it also means something is bad. */
-	fs->group_desc[group].bg_flags &= ~(EXT2_BG_INODE_UNINIT |
-					    EXT2_BG_BLOCK_UNINIT);
+	fs->group_desc[group].bg_flags &= ~EXT2_BG_INODE_UNINIT;
 	if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
 				       EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
 		ext2_ino_t first_unused_inode =	fs->super->s_inodes_per_group -
@@ -42,7 +41,6 @@
 			fs->group_desc[group].bg_itable_unused =
 				group * fs->super->s_inodes_per_group +
 				fs->super->s_inodes_per_group - ino;
-
 		ext2fs_group_desc_csum_set(fs, group);
 	}