From: Theodore Ts'o Date: Wed, 27 Aug 2008 22:38:47 +0000 (-0400) Subject: debugfs: Use extents when writing a file if the filesystem supports them X-Git-Tag: v1.41.1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eaf8fedcfec197b62d3ef9b9c5ef4938dd63d3a0;p=thirdparty%2Fe2fsprogs.git debugfs: Use extents when writing a file if the filesystem supports them Signed-off-by: "Theodore Ts'o" --- diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index 620a513c3..8b2f31e53 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -1387,6 +1387,9 @@ void do_write(int argc, char *argv[]) current_fs->now ? current_fs->now : time(0); inode.i_links_count = 1; inode.i_size = statbuf.st_size; + if (current_fs->super->s_feature_incompat & + EXT3_FEATURE_INCOMPAT_EXTENTS) + inode.i_flags |= EXT4_EXTENTS_FL; if (debugfs_write_new_inode(newfile, &inode, argv[0])) { close(fd); return;