Skip to contentSkip to conversation

Btrfs: don't auto defrag a file when doing directIO

PATCH New Miao Xie 1 participant 1 message Dec 5, 2012 Btrfs file system

lore
Share & tools
lore

Miao Xie

author
#0 lore raw

PATCH 1/6 Btrfs: don't auto defrag a file when doing directIO

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.

---
 fs/btrfs/inode.c | 3 ---
 1 file changed, 3 deletions(-)
fs/btrfs/inode.c +0 -3
index 5fc0990..b08e4b1 100644
@@ -5674,9 +5674,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);
Signature · 1 line
1.7.11.7