diff options
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r-- | fs/btrfs/file-item.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index 964652435fd1..9b99886562d0 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c | |||
@@ -52,6 +52,7 @@ int btrfs_insert_file_extent(struct btrfs_trans_handle *trans, | |||
52 | file_key.offset = pos; | 52 | file_key.offset = pos; |
53 | btrfs_set_key_type(&file_key, BTRFS_EXTENT_DATA_KEY); | 53 | btrfs_set_key_type(&file_key, BTRFS_EXTENT_DATA_KEY); |
54 | 54 | ||
55 | path->leave_spinning = 1; | ||
55 | ret = btrfs_insert_empty_item(trans, root, path, &file_key, | 56 | ret = btrfs_insert_empty_item(trans, root, path, &file_key, |
56 | sizeof(*item)); | 57 | sizeof(*item)); |
57 | if (ret < 0) | 58 | if (ret < 0) |
@@ -523,6 +524,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans, | |||
523 | key.offset = end_byte - 1; | 524 | key.offset = end_byte - 1; |
524 | key.type = BTRFS_EXTENT_CSUM_KEY; | 525 | key.type = BTRFS_EXTENT_CSUM_KEY; |
525 | 526 | ||
527 | path->leave_spinning = 1; | ||
526 | ret = btrfs_search_slot(trans, root, &key, path, -1, 1); | 528 | ret = btrfs_search_slot(trans, root, &key, path, -1, 1); |
527 | if (ret > 0) { | 529 | if (ret > 0) { |
528 | if (path->slots[0] == 0) | 530 | if (path->slots[0] == 0) |
@@ -757,8 +759,10 @@ insert: | |||
757 | } else { | 759 | } else { |
758 | ins_size = csum_size; | 760 | ins_size = csum_size; |
759 | } | 761 | } |
762 | path->leave_spinning = 1; | ||
760 | ret = btrfs_insert_empty_item(trans, root, path, &file_key, | 763 | ret = btrfs_insert_empty_item(trans, root, path, &file_key, |
761 | ins_size); | 764 | ins_size); |
765 | path->leave_spinning = 0; | ||
762 | if (ret < 0) | 766 | if (ret < 0) |
763 | goto fail_unlock; | 767 | goto fail_unlock; |
764 | if (ret != 0) { | 768 | if (ret != 0) { |
@@ -776,7 +780,6 @@ found: | |||
776 | item_end = (struct btrfs_csum_item *)((unsigned char *)item_end + | 780 | item_end = (struct btrfs_csum_item *)((unsigned char *)item_end + |
777 | btrfs_item_size_nr(leaf, path->slots[0])); | 781 | btrfs_item_size_nr(leaf, path->slots[0])); |
778 | eb_token = NULL; | 782 | eb_token = NULL; |
779 | cond_resched(); | ||
780 | next_sector: | 783 | next_sector: |
781 | 784 | ||
782 | if (!eb_token || | 785 | if (!eb_token || |
@@ -817,9 +820,9 @@ next_sector: | |||
817 | eb_token = NULL; | 820 | eb_token = NULL; |
818 | } | 821 | } |
819 | btrfs_mark_buffer_dirty(path->nodes[0]); | 822 | btrfs_mark_buffer_dirty(path->nodes[0]); |
820 | cond_resched(); | ||
821 | if (total_bytes < sums->len) { | 823 | if (total_bytes < sums->len) { |
822 | btrfs_release_path(root, path); | 824 | btrfs_release_path(root, path); |
825 | cond_resched(); | ||
823 | goto again; | 826 | goto again; |
824 | } | 827 | } |
825 | out: | 828 | out: |