Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318835
b: refs/heads/master
c: a43a211
h: refs/heads/master
i:
  318833: f8d1648
  318831: 1e8ba6f
v: v3
  • Loading branch information
Andrew Mahone authored and Chris Mason committed Jul 23, 2012
1 parent bca75a7 commit 8655a8c
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: e4b50e14c8f72bcbae53809815d5df70d5aec174
refs/heads/master: a43a21113365e5a9b59efc411da715d910cca87c
8 changes: 5 additions & 3 deletions trunk/fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,8 @@ static bool defrag_check_next_extent(struct inode *inode, struct extent_map *em)
}

static int should_defrag_range(struct inode *inode, u64 start, int thresh,
u64 *last_len, u64 *skip, u64 *defrag_end)
u64 *last_len, u64 *skip, u64 *defrag_end,
int compress)
{
struct extent_map *em;
int ret = 1;
Expand Down Expand Up @@ -863,7 +864,7 @@ static int should_defrag_range(struct inode *inode, u64 start, int thresh,
* we hit a real extent, if it is big or the next extent is not a
* real extent, don't bother defragging it
*/
if ((*last_len == 0 || *last_len >= thresh) &&
if (!compress && (*last_len == 0 || *last_len >= thresh) &&
(em->len >= thresh || !next_mergeable))
ret = 0;
out:
Expand Down Expand Up @@ -1145,7 +1146,8 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,

if (!should_defrag_range(inode, (u64)i << PAGE_CACHE_SHIFT,
extent_thresh, &last_len, &skip,
&defrag_end)) {
&defrag_end, range->flags &
BTRFS_DEFRAG_RANGE_COMPRESS)) {
unsigned long next;
/*
* the should_defrag function tells us how much to skip
Expand Down

0 comments on commit 8655a8c

Please sign in to comment.