Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 374879
b: refs/heads/master
c: 0abd5b1
h: refs/heads/master
i:
  374877: 9563354
  374875: 10795b2
  374871: 2f8db71
  374863: 664ad5e
  374847: 1ecfc74
v: v3
  • Loading branch information
Liu Bo authored and Josef Bacik committed May 6, 2013
1 parent 4d9b23c commit d722b36
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 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: 3c59ccd32abb8f636b1573533d3e77972e80a9c9
refs/heads/master: 0abd5b17249ea5ca49a3a9ad4285cac3dfa8c30b
11 changes: 7 additions & 4 deletions trunk/fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,11 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,
u64 new_align = ~((u64)128 * 1024 - 1);
struct page **pages = NULL;

if (extent_thresh == 0)
extent_thresh = 256 * 1024;
if (isize == 0)
return 0;

if (range->start >= isize)
return -EINVAL;

if (range->flags & BTRFS_DEFRAG_RANGE_COMPRESS) {
if (range->compress_type > BTRFS_COMPRESS_TYPES)
Expand All @@ -1164,8 +1167,8 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,
compress_type = range->compress_type;
}

if (isize == 0)
return 0;
if (extent_thresh == 0)
extent_thresh = 256 * 1024;

/*
* if we were not given a file, allocate a readahead
Expand Down

0 comments on commit d722b36

Please sign in to comment.