X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=helper%2Fext2.c;h=56ad5e569026012f06b6f0c7e4a93b3d34ebaa82;hb=refs%2Ftags%2F3.11;hp=fd675683c26bdc435a2059e7d6d8cd40ac562fb9;hpb=6ee123ac387c8b3b8b60418596b8d1bae99c5b01;p=febootstrap.git diff --git a/helper/ext2.c b/helper/ext2.c index fd67568..56ad5e5 100644 --- a/helper/ext2.c +++ b/helper/ext2.c @@ -43,13 +43,13 @@ ext2_filsys fs; * * The downside of allocating a very large initial disk is that the * fixed overhead of ext2 is larger (since ext2 calculates it based on - * the size of the disk). For a 1GB disk the overhead is - * approximately 16MB. + * the size of the disk). For a 4GB disk the overhead is + * approximately 66MB. * * In future, make this configurable, or determine it from the input * files (XXX). */ -#define APPLIANCE_SIZE (1024*1024*1024) +#define APPLIANCE_SIZE ((off_t)4*1024*1024*1024) static void ext2_start (const char *hostcpu, const char *appliance, @@ -65,7 +65,7 @@ ext2_start (const char *hostcpu, const char *appliance, if (fd == -1) error (EXIT_FAILURE, errno, "open: %s", appliance); - if (lseek (fd, APPLIANCE_SIZE - 1, SEEK_SET) == -1) + if (lseek (fd, APPLIANCE_SIZE - 1, SEEK_SET) == (off_t) -1) error (EXIT_FAILURE, errno, "lseek"); char c = 0; @@ -107,8 +107,16 @@ ext2_start (const char *hostcpu, const char *appliance, 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)); }