btrfs: Kill some bi_idx references
authorKent Overstreet <koverstreet@google.com>
Tue, 11 Sep 2012 20:23:05 +0000 (14:23 -0600)
committerChris Mason <chris.mason@fusionio.com>
Mon, 1 Oct 2012 19:19:21 +0000 (15:19 -0400)
For immutable bio vecs, I've been auditing and removing bi_idx
references. These were harmless, but removing them will make auditing
easier.

scrub_bio_end_io_worker() was open coding a bio_reset() - but this
doesn't appear to have been needed for anything as right after it does a
bio_put(), and perusing the code it doesn't appear anything else was
holding a reference to the bio.

The other use end_bio_extent_readpage() was just for a pr_debug() -
changed it to something that might be a bit more useful.

Signed-off-by: Kent Overstreet <koverstreet@google.com>
CC: Chris Mason <chris.mason@oracle.com>
CC: Stefan Behrens <sbehrens@giantdisaster.de>
fs/btrfs/extent_io.c
fs/btrfs/scrub.c

index 3ad84f50068714bed0cee58724ea36368ece476a..90bd9f768c0a5e48ed8d37612ff0efc3e9f0faaf 100644 (file)
@@ -2306,8 +2306,8 @@ static void end_bio_extent_readpage(struct bio *bio, int err)
                struct extent_state *cached = NULL;
                struct extent_state *state;
 
-               pr_debug("end_bio_extent_readpage: bi_vcnt=%d, idx=%d, err=%d, "
-                        "mirror=%ld\n", bio->bi_vcnt, bio->bi_idx, err,
+               pr_debug("end_bio_extent_readpage: bi_sector=%llu, err=%d, "
+                        "mirror=%ld\n", (u64)bio->bi_sector, err,
                         (long int)bio->bi_bdev);
                tree = &BTRFS_I(page->mapping->host)->io_tree;
 
index d3bb901ade42e5fe5bda32be305ddd6c8dd72930..27892f67e69b216694299720caf31b6e19919555 100644 (file)
@@ -1669,21 +1669,6 @@ static void scrub_bio_end_io_worker(struct btrfs_work *work)
                scrub_block_put(sblock);
        }
 
-       if (sbio->err) {
-               /* what is this good for??? */
-               sbio->bio->bi_flags &= ~(BIO_POOL_MASK - 1);
-               sbio->bio->bi_flags |= 1 << BIO_UPTODATE;
-               sbio->bio->bi_phys_segments = 0;
-               sbio->bio->bi_idx = 0;
-
-               for (i = 0; i < sbio->page_count; i++) {
-                       struct bio_vec *bi;
-                       bi = &sbio->bio->bi_io_vec[i];
-                       bi->bv_offset = 0;
-                       bi->bv_len = PAGE_SIZE;
-               }
-       }
-
        bio_put(sbio->bio);
        sbio->bio = NULL;
        spin_lock(&sdev->list_lock);