Skip to content

Commit

Permalink
Btrfs: don't auto defrag a file when doing directIO
Browse files Browse the repository at this point in the history
If we runt the direct IO, we should not run auto defrag, because it may
introduce buffered IO vs direcIO problem, and make direct IO slow down.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
  • Loading branch information
Miao Xie authored and Chris Mason committed Dec 17, 2012
1 parent fb57dc8 commit 543eabd
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -5692,9 +5692,6 @@ static struct extent_map *btrfs_new_extent_direct(struct inode *inode,
if (IS_ERR(trans))
return ERR_CAST(trans);

if (start <= BTRFS_I(inode)->disk_i_size && len < 64 * 1024)
btrfs_add_inode_defrag(trans, inode);

trans->block_rsv = &root->fs_info->delalloc_block_rsv;

alloc_hint = get_extent_allocation_hint(inode, start, len);
Expand Down

0 comments on commit 543eabd

Please sign in to comment.