Commit 392e4845 authored by Ed L. Cashin's avatar Ed L. Cashin Committed by Greg Kroah-Hartman

aoe: use bio->bi_idx

Instead of starting with bio->bi_io_vec, use the offset in bio->bi_idx.
Signed-off-by: default avatar"Ed L. Cashin" <ecashin@coraid.com>
Acked-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b751e8b6
...@@ -142,7 +142,8 @@ aoeblk_make_request(request_queue_t *q, struct bio *bio) ...@@ -142,7 +142,8 @@ aoeblk_make_request(request_queue_t *q, struct bio *bio)
buf->bio = bio; buf->bio = bio;
buf->resid = bio->bi_size; buf->resid = bio->bi_size;
buf->sector = bio->bi_sector; 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->bv_resid = buf->bv->bv_len;
buf->bufaddr = page_address(buf->bv->bv_page) + buf->bv->bv_offset; buf->bufaddr = page_address(buf->bv->bv_page) + buf->bv->bv_offset;
......
...@@ -166,6 +166,7 @@ aoecmd_ata_rw(struct aoedev *d, struct frame *f) ...@@ -166,6 +166,7 @@ aoecmd_ata_rw(struct aoedev *d, struct frame *f)
d->inprocess = NULL; d->inprocess = NULL;
} else if (buf->bv_resid == 0) { } else if (buf->bv_resid == 0) {
buf->bv++; buf->bv++;
WARN_ON(buf->bv->bv_len == 0);
buf->bv_resid = buf->bv->bv_len; buf->bv_resid = buf->bv->bv_len;
buf->bufaddr = page_address(buf->bv->bv_page) + buf->bv->bv_offset; buf->bufaddr = page_address(buf->bv->bv_page) + buf->bv->bv_offset;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment