OSDN Git Service

libext2fs: add flag to ext2fs_flush() and ext2fs_close() to avoid fsync
authorRichard W.M. Jones <rjones@redhat.com>
Sat, 24 Sep 2011 14:50:42 +0000 (10:50 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 24 Sep 2011 16:53:16 +0000 (12:53 -0400)
commit9d9a53e651fa877eb4f9df0bfd97fbcc5f514293
treed3801bd42e78b5ece11bb4601dd602dd879c048b
parentaf67c12f77f22b521486ea1e969a820039a1561e
libext2fs: add flag to ext2fs_flush() and ext2fs_close() to avoid fsync

This adds new APIs: ext2fs_flush2 and ext2fs_close2 which take an
extra 'int flags' parameter.

This allows us to pass in an EXT2_FLAG_FLUSH_NO_SYNC flag which avoids
fsync'ing the filesystem when closing it.  For the case we have in
mind where we are just constructing a throwaway ext2 filesystem in a
file in order to boot a VM, this saves over 5 seconds during the boot
process and avoids many unnecessary disk writes.

Existing code using ext2fs_flush and ext2fs_close remains unaffected
by this change.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debian/e2fslibs.symbols
lib/ext2fs/closefs.c
lib/ext2fs/ext2fs.h