Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297914
b: refs/heads/master
c: 4cb13e5
h: refs/heads/master
v: v3
  • Loading branch information
Liu Bo authored and Chris Mason committed Mar 29, 2012
1 parent e8863d4 commit d7c9630
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1f12bd063285b059cb63315d1424dae1ddd87a64
refs/heads/master: 4cb13e5d6ecc47b91b24a35f8fbc2c9f33d075fe
8 changes: 5 additions & 3 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@ static noinline int compress_file_range(struct inode *inode,
int will_compress;
int compress_type = root->fs_info->compress_type;

/* if this is a small write inside eof, kick off a defragbot */
if (end <= BTRFS_I(inode)->disk_i_size && (end - start + 1) < 16 * 1024)
/* if this is a small write inside eof, kick off a defrag */
if ((end - start + 1) < 16 * 1024 &&
(start > 0 || end + 1 < BTRFS_I(inode)->disk_i_size))
btrfs_add_inode_defrag(NULL, inode);

actual_end = min_t(u64, isize, end + 1);
Expand Down Expand Up @@ -843,7 +844,8 @@ static noinline int cow_file_range(struct inode *inode,
ret = 0;

/* if this is a small write inside eof, kick off defrag */
if (end <= BTRFS_I(inode)->disk_i_size && num_bytes < 64 * 1024)
if (num_bytes < 64 * 1024 &&
(start > 0 || end + 1 < BTRFS_I(inode)->disk_i_size))
btrfs_add_inode_defrag(trans, inode);

if (start == 0) {
Expand Down

0 comments on commit d7c9630

Please sign in to comment.