btrfs: Remove special handling of EXTENT_BUFFER_UNMAPPED while freeing
[sfrench/cifs-2.6.git] / fs / btrfs / extent_io.c
index 160efb201ef3491ab2a3bf9bf8b8060d39eb1cea..39a41e8777fc5dbd4062ad1026cfc7f171500117 100644 (file)
@@ -4893,13 +4893,6 @@ again:
        check_buffer_tree_ref(eb);
        set_bit(EXTENT_BUFFER_IN_TREE, &eb->bflags);
 
-       /*
-        * We will free dummy extent buffer's if they come into
-        * free_extent_buffer with a ref count of 2, but if we are using this we
-        * want the buffers to stay in memory until we're done with them, so
-        * bump the ref count again.
-        */
-       atomic_inc(&eb->refs);
        return eb;
 free_eb:
        btrfs_release_extent_buffer(eb);
@@ -5089,10 +5082,6 @@ void free_extent_buffer(struct extent_buffer *eb)
        }
 
        spin_lock(&eb->refs_lock);
-       if (atomic_read(&eb->refs) == 2 &&
-           test_bit(EXTENT_BUFFER_UNMAPPED, &eb->bflags))
-               atomic_dec(&eb->refs);
-
        if (atomic_read(&eb->refs) == 2 &&
            test_bit(EXTENT_BUFFER_STALE, &eb->bflags) &&
            !extent_buffer_under_io(eb) &&