This saves over 5 seconds during the slow path construction of the
appliance.
The ext2fs_close2 API is present in the e2fsprogs 'next' branch and
will be in a later e2fsprogs release (thanks Ted Ts'o).
AC_CHECK_LIB([ext2fs],[ext2fs_file_open2],[],[
AC_MSG_FAILURE([libext2fs library not found (part of e2fsprogs)])
])
+AC_CHECK_FUNCS([ext2fs_close2])
LIBS="$old_LIBS"
AC_CHECK_HEADER([ext2fs/ext2fs.h],[],[
static void
ext2_end (void)
{
+ if (verbose)
+ print_timestamped_message ("closing ext2 filesystem");
+
/* Write out changes and close. */
- errcode_t err = ext2fs_close (fs);
+ errcode_t err;
+#ifdef HAVE_EXT2FS_CLOSE2
+ err = ext2fs_close2 (fs, EXT2_FLAG_FLUSH_NO_SYNC);
+#else
+ err = ext2fs_close (fs);
+#endif
if (err != 0)
error (EXIT_FAILURE, 0, "ext2fs_close: %s", error_message (err));
}