diff options
author | Lukas Czerner <lczerner@redhat.com> | 2011-09-13 22:24:11 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-09-13 22:42:19 -0400 |
commit | faa2dcdad0f5af3945a70bdecc8713b3a74cdf9c (patch) | |
tree | 77ce58f1c9bc81f2540ab7dd8f81e840a086118f /misc/util.c | |
parent | 906a1cf9b60b336ccf44706c7f1906056282fbf0 (diff) | |
download | e2fsprogs-faa2dcdad0f5af3945a70bdecc8713b3a74cdf9c.tar.gz |
mke2fs: Use ext2fs_flush() only once
We are doing ext2fs_flush() twice right now at the end of the mke2fs.
First by directly calling ext2fs_flush() which is intended to write
superblock and fs accounting information. And then it is invoked again
when we are calling ext2fs_close(), only this time, because the fs is
not dirty, we are writing out only superblock.
I think it is bad to call it twice because even when writing only super
block it takes some time on bigger file systems and moreover
ext2fs_close() can fail without any reasonable explanation for the user.
Also ext2fs_flush() is printing out progress and it is confusing for the
users.
Fix all this by removing the ext2fs_flush() and leaving it all to
ext2fs_close(). However we need to introduce new variables to store
check interval and max mount count, because fs structure is freed on
ext2fs_close() and we really want to print those information as the last
info for the user.
[ Fixed type mismatch in a printf format statement -tytso]
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'misc/util.c')
-rw-r--r-- | misc/util.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/misc/util.c b/misc/util.c index 51bdb60f..f3ee2bb9 100644 --- a/misc/util.c +++ b/misc/util.c @@ -282,12 +282,11 @@ unsigned int figure_journal_size(int size, ext2_filsys fs) return j_blocks; } -void print_check_message(ext2_filsys fs) +void print_check_message(unsigned int mnt, unsigned int check) { printf(_("This filesystem will be automatically " "checked every %d mounts or\n" "%g days, whichever comes first. " "Use tune2fs -c or -i to override.\n"), - fs->super->s_max_mnt_count, - (double)fs->super->s_checkinterval / (3600 * 24)); + mnt, ((double) check) / (3600 * 24)); } |