Whamcloud - gitweb
debugfs: Use extents when writing a file if the filesystem supports them
authorTheodore Ts'o <tytso@mit.edu>
Wed, 27 Aug 2008 22:38:47 +0000 (18:38 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 27 Aug 2008 22:38:47 +0000 (18:38 -0400)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
debugfs/debugfs.c

index 620a513..8b2f31e 100644 (file)
@@ -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;