drbd: merge_bvec_fn: properly remap bvm->bi_bdev
[pandora-kernel.git] / drivers / block / drbd / drbd_req.c
index 3424d67..43da226 100644 (file)
@@ -37,6 +37,7 @@ static void _drbd_start_io_acct(struct drbd_conf *mdev, struct drbd_request *req
        const int rw = bio_data_dir(bio);
        int cpu;
        cpu = part_stat_lock();
+       part_round_stats(cpu, &mdev->vdisk->part0);
        part_stat_inc(cpu, &mdev->vdisk->part0, ios[rw]);
        part_stat_add(cpu, &mdev->vdisk->part0, sectors[rw], bio_sectors(bio));
        part_inc_in_flight(&mdev->vdisk->part0, rw);
@@ -1073,7 +1074,7 @@ static int drbd_fail_request_early(struct drbd_conf *mdev, int is_write)
        return 0;
 }
 
-int drbd_make_request(struct request_queue *q, struct bio *bio)
+void drbd_make_request(struct request_queue *q, struct bio *bio)
 {
        unsigned int s_enr, e_enr;
        struct drbd_conf *mdev = (struct drbd_conf *) q->queuedata;
@@ -1081,7 +1082,7 @@ int drbd_make_request(struct request_queue *q, struct bio *bio)
 
        if (drbd_fail_request_early(mdev, bio_data_dir(bio) & WRITE)) {
                bio_endio(bio, -EPERM);
-               return 0;
+               return;
        }
 
        start_time = jiffies;
@@ -1100,7 +1101,8 @@ int drbd_make_request(struct request_queue *q, struct bio *bio)
 
        if (likely(s_enr == e_enr)) {
                inc_ap_bio(mdev, 1);
-               return drbd_make_request_common(mdev, bio, start_time);
+               drbd_make_request_common(mdev, bio, start_time);
+               return;
        }
 
        /* can this bio be split generically?
@@ -1148,7 +1150,6 @@ int drbd_make_request(struct request_queue *q, struct bio *bio)
 
                bio_pair_release(bp);
        }
-       return 0;
 }
 
 /* This is called by bio_add_page().  With this function we reduce
@@ -1183,6 +1184,7 @@ int drbd_merge_bvec(struct request_queue *q, struct bvec_merge_data *bvm, struct
                struct request_queue * const b =
                        mdev->ldev->backing_bdev->bd_disk->queue;
                if (b->merge_bvec_fn) {
+                       bvm->bi_bdev = mdev->ldev->backing_bdev;
                        backing_limit = b->merge_bvec_fn(b, bvm, bvec);
                        limit = min(limit, backing_limit);
                }