Btrfs end_bio_extent_readpage should look for locked bits
Chris Mason [Sat, 16 Apr 2011 10:55:39 +0000 (06:55 -0400)]
A recent commit caches the extent state in end_bio_extent_readpage,
but the search it does should look for locked extents.  This
fixes things to make it more effective.

Signed-off-by: Chris Mason <chris.mason@oracle.com>

fs/btrfs/extent_io.c

index 1c462f8..5ae0bff 100644 (file)
@@ -1761,7 +1761,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err)
                        prefetchw(&bvec->bv_page->flags);
 
                spin_lock(&tree->lock);
-               state = find_first_extent_bit_state(tree, start, 0);
+               state = find_first_extent_bit_state(tree, start, EXTENT_LOCKED);
                if (state && state->start == start) {
                        /*
                         * take a reference on the state, unlock will drop