Btrfs: Add run time btree defrag, and an ioctl to force btree defrag
[firefly-linux-kernel-4.4.55.git] / fs / btrfs / file.c
index 1fe38fe841502d3a1e40394b6f559f186759968f..00b118a2db6925ba0810a461bd484dfa7a855391 100644 (file)
@@ -512,7 +512,7 @@ static int prepare_pages(struct btrfs_root *root,
        if (isize >= PAGE_CACHE_SIZE || pos + write_bytes < inode->i_size ||
            pos + write_bytes - start_pos > BTRFS_MAX_INLINE_DATA_SIZE(root)) {
                err = btrfs_alloc_extent(trans, root, inode->i_ino,
-                                        num_blocks, hint_block, (u64)-1,
+                                        num_blocks, 0, hint_block, (u64)-1,
                                         &ins, 1);
                if (err)
                        goto failed_truncate;