]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
mke2fs: Use ext2fs_flush() only once
authorLukas Czerner <lczerner@redhat.com>
Wed, 14 Sep 2011 02:24:11 +0000 (22:24 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 14 Sep 2011 02:42:19 +0000 (22:42 -0400)
commitfaa2dcdad0f5af3945a70bdecc8713b3a74cdf9c
tree77ce58f1c9bc81f2540ab7dd8f81e840a086118f
parent906a1cf9b60b336ccf44706c7f1906056282fbf0
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>
misc/mke2fs.c
misc/tune2fs.c
misc/util.c
misc/util.h
tests/m_extent_journal/expect.1
tests/m_uninit/expect.1