]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
resize2fs: use EXT2_FLAG_64BITS
authorSami Liedes <sami.liedes@iki.fi>
Thu, 22 Mar 2012 23:46:56 +0000 (19:46 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 22 Mar 2012 23:46:59 +0000 (19:46 -0400)
By passing EXT2_FLAG_64BITS to ext2fs_open2() we can avoid some
unnecessary redirection in critical paths. While resize2fs does not
currently otherwise support so big filesystems that this would matter,
passing this flag is entirely harmless and only tells libext2fs that
the caller has been recompiled against current headers.

With this change the CPU time needed to shrink a 100G filesystem drops
by 20%.

Signed-off-by: Sami Liedes <sami.liedes@iki.fi>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
resize/main.c

index ffefe0193fd9f2f38b3e7676306e8724f520a684..e6604f2870f0741214637cddc310c18bfa1e435b 100644 (file)
@@ -294,6 +294,9 @@ int main (int argc, char ** argv)
 
        if (!(mount_flags & EXT2_MF_MOUNTED))
                io_flags = EXT2_FLAG_RW | EXT2_FLAG_EXCLUSIVE;
+
+       io_flags |= EXT2_FLAG_64BITS;
+
        retval = ext2fs_open2(device_name, io_options, io_flags,
                              0, 0, io_ptr, &fs);
        if (retval) {