aoe: use bio->bi_idx
authorEd L. Cashin <ecashin@coraid.com>
Wed, 20 Sep 2006 18:36:50 +0000 (14:36 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 18 Oct 2006 19:53:50 +0000 (12:53 -0700)
Instead of starting with bio->bi_io_vec, use the offset in bio->bi_idx.

Signed-off-by: "Ed L. Cashin" <ecashin@coraid.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/block/aoe/aoeblk.c
drivers/block/aoe/aoecmd.c

index a7dbe6f..196ae7a 100644 (file)
@@ -142,7 +142,8 @@ aoeblk_make_request(request_queue_t *q, struct bio *bio)
        buf->bio = bio;
        buf->resid = bio->bi_size;
        buf->sector = bio->bi_sector;
-       buf->bv = buf->bio->bi_io_vec;
+       buf->bv = &bio->bi_io_vec[bio->bi_idx];
+       WARN_ON(buf->bv->bv_len == 0);
        buf->bv_resid = buf->bv->bv_len;
        buf->bufaddr = page_address(buf->bv->bv_page) + buf->bv->bv_offset;
 
index f2b8f55..2d0bcdd 100644 (file)
@@ -166,6 +166,7 @@ aoecmd_ata_rw(struct aoedev *d, struct frame *f)
                d->inprocess = NULL;
        } else if (buf->bv_resid == 0) {
                buf->bv++;
+               WARN_ON(buf->bv->bv_len == 0);
                buf->bv_resid = buf->bv->bv_len;
                buf->bufaddr = page_address(buf->bv->bv_page) + buf->bv->bv_offset;
        }