]> git.hungrycats.org Git - linux/commitdiff
Revert "zygo: apply for_zygo.patch from fdmanana"
authorZygo Blaxell <zblaxell@thirteen.furryterror.org>
Tue, 26 May 2015 11:56:29 +0000 (07:56 -0400)
committerZygo Blaxell <zblaxell@thirteen.furryterror.org>
Tue, 26 May 2015 11:56:29 +0000 (07:56 -0400)
This reverts commit 64ec75a582289f4d480d476d8595f30545784d95.

fs/btrfs/inode.c

index 43ce394f9691ff24a2be48958e1fb716241cb07f..94876bf1861e00ffeed3692e954ae5dab98f37f5 100644 (file)
@@ -4896,15 +4896,22 @@ static void evict_inode_truncate_pages(struct inode *inode)
 
        spin_lock(&io_tree->lock);
        while (!RB_EMPTY_ROOT(&io_tree->state)) {
+               struct extent_state *state;
                struct extent_state *cached_state = NULL;
 
+               node = rb_first(&io_tree->state);
+               state = rb_entry(node, struct extent_state, rb_node);
+               atomic_inc(&state->refs);
                spin_unlock(&io_tree->lock);
-               lock_extent_bits(io_tree, 0, (u64)-1, 0, &cached_state);
-               clear_extent_bit(io_tree, 0, (u64)-1,
+
+               lock_extent_bits(io_tree, state->start, state->end,
+                                0, &cached_state);
+               clear_extent_bit(io_tree, state->start, state->end,
                                 EXTENT_LOCKED | EXTENT_DIRTY |
                                 EXTENT_DELALLOC | EXTENT_DO_ACCOUNTING |
                                 EXTENT_DEFRAG, 1, 1,
                                 &cached_state, GFP_NOFS);
+               free_extent_state(state);
 
                cond_resched();
                spin_lock(&io_tree->lock);