aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-05-18 12:13:33 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-05-18 12:13:33 -0400
commit16ee6576e25b83806d26eb771138249fcfb5eddc (patch)
tree7c717b80f28b5c59ba673dc00f2ca9bd0fc068d4 /fs/btrfs/file.c
parent16fa7e8200fb9066b77a3f27cbed8e4a9fc71998 (diff)
parent9b63776fa3ca96c4ecda76f6fa947b7b0add66ac (diff)
Merge remote-tracking branch 'tip/perf/urgent' into perf/core
Merge reason: We are going to queue up a dependent patch: "perf tools: Move parse event automated tests to separated object" That depends on: commit e7c72d8 perf tools: Add 'G' and 'H' modifiers to event parsing Conflicts: tools/perf/builtin-stat.c Conflicted with the recent 'perf_target' patches when checking the result of perf_evsel open routines to see if a retry is needed to cope with older kernels where the exclude guest/host perf_event_attr bits were not used. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c9
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,
567 int extent_type; 567 int extent_type;
568 int recow; 568 int recow;
569 int ret; 569 int ret;
570 int modify_tree = -1;
570 571
571 if (drop_cache) 572 if (drop_cache)
572 btrfs_drop_extent_cache(inode, start, end - 1, 0); 573 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,
575 if (!path) 576 if (!path)
576 return -ENOMEM; 577 return -ENOMEM;
577 578
579 if (start >= BTRFS_I(inode)->disk_i_size)
580 modify_tree = 0;
581
578 while (1) { 582 while (1) {
579 recow = 0; 583 recow = 0;
580 ret = btrfs_lookup_file_extent(trans, root, path, ino, 584 ret = btrfs_lookup_file_extent(trans, root, path, ino,
581 search_start, -1); 585 search_start, modify_tree);
582 if (ret < 0) 586 if (ret < 0)
583 break; 587 break;
584 if (ret > 0 && path->slots[0] > 0 && search_start == start) { 588 if (ret > 0 && path->slots[0] > 0 && search_start == start) {
@@ -634,7 +638,8 @@ next_slot:
634 } 638 }
635 639
636 search_start = max(key.offset, start); 640 search_start = max(key.offset, start);
637 if (recow) { 641 if (recow || !modify_tree) {
642 modify_tree = -1;
638 btrfs_release_path(path); 643 btrfs_release_path(path);
639 continue; 644 continue;
640 } 645 }