]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
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 a7dbe6f53c14f4c20a0f9cea8b6b0faf2f2de09e..196ae7a37643f594c42df78ef1954705f7d69edc 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 f2b8f558e1bb4e6ba0dbbadfa41cd27b7129f3cd..2d0bcdd96698d3c60bda0122754abdba650df637 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;
        }