From ecashin@coraid.com Wed Sep 20 11:57:16 2006 Message-ID: <92cac25de1f5bd5a56287f13e77a00bc@coraid.com> Date: Wed, 20 Sep 2006 14:36:50 -0400 From: "Ed L. Cashin" To: linux-kernel@vger.kernel.org Cc: ecashin@coraid.com, Greg K-H Subject: aoe: use bio->bi_idx Instead of starting with bio->bi_io_vec, use the offset in bio->bi_idx. Signed-off-by: "Ed L. Cashin" Acked-by: Alan Cox Signed-off-by: Greg Kroah-Hartman --- drivers/block/aoe/aoeblk.c | 3 ++- drivers/block/aoe/aoecmd.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) --- gregkh-2.6.orig/drivers/block/aoe/aoeblk.c +++ gregkh-2.6/drivers/block/aoe/aoeblk.c @@ -142,7 +142,8 @@ aoeblk_make_request(request_queue_t *q, 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; --- gregkh-2.6.orig/drivers/block/aoe/aoecmd.c +++ gregkh-2.6/drivers/block/aoe/aoecmd.c @@ -166,6 +166,7 @@ aoecmd_ata_rw(struct aoedev *d, struct 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; }