diff options
author | Paul Mundt <lethal@linux-sh.org> | 2012-05-10 04:51:07 +0200 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2012-05-10 04:51:07 +0200 |
commit | 15f99cbd071aa402e113d342448603344a337046 (patch) | |
tree | 56f98892d1bd38029988eb8931e2321ef7e79aa0 /fs/btrfs/file.c | |
parent | sh64: Kill off unused trap_no/error_code from thread_struct. (diff) | |
parent | sh: Add pinmux for sh7264 (diff) | |
download | linux-15f99cbd071aa402e113d342448603344a337046.tar.xz linux-15f99cbd071aa402e113d342448603344a337046.zip |
Merge branch 'sh/rsk-updates' into sh-latest
Conflicts:
arch/sh/Kconfig
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index d83260d7498f..53bf2d764bbc 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -567,6 +567,7 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode, int extent_type; int recow; int ret; + int modify_tree = -1; if (drop_cache) btrfs_drop_extent_cache(inode, start, end - 1, 0); @@ -575,10 +576,13 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, struct inode *inode, if (!path) return -ENOMEM; + if (start >= BTRFS_I(inode)->disk_i_size) + modify_tree = 0; + while (1) { recow = 0; ret = btrfs_lookup_file_extent(trans, root, path, ino, - search_start, -1); + search_start, modify_tree); if (ret < 0) break; if (ret > 0 && path->slots[0] > 0 && search_start == start) { @@ -634,7 +638,8 @@ next_slot: } search_start = max(key.offset, start); - if (recow) { + if (recow || !modify_tree) { + modify_tree = -1; btrfs_release_path(path); continue; } |