diff --git a/infiniswap_bd/is_mq.c b/infiniswap_bd/is_mq.c index 224c9d1..24937cd 100644 --- a/infiniswap_bd/is_mq.c +++ b/infiniswap_bd/is_mq.c @@ -216,8 +216,6 @@ void stackbd_make_request2(struct request_queue *q, struct request *req) { struct bio *bio = NULL; struct bio *b = req->bio; - int i; - int len = req->nr_phys_segments; spin_lock_irq(&stackbd.lock); if (!stackbd.bdev_raw) @@ -230,15 +228,14 @@ void stackbd_make_request2(struct request_queue *q, struct request *req) printk("stackbd: Device not active yet, aborting\n"); goto abort; } - for (i=0; ibi_next; + + for (; b; b = b->bi_next) + { + bio = bio_clone(b, GFP_ATOMIC); + bio->bi_end_io = (bio_end_io_t*)IS_stackbd_end_io; + bio->bi_private = (void*) uint64_from_ptr(req); + bio_list_add(&stackbd.bio_list, bio); } - bio = bio_clone(b, GFP_ATOMIC); - bio->bi_end_io = (bio_end_io_t*)IS_stackbd_end_io; - bio->bi_private = (void*) uint64_from_ptr(req); - bio_list_add(&stackbd.bio_list, bio); wake_up(&req_event); spin_unlock_irq(&stackbd.lock);