These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / block / drbd / drbd_req.c
index 3907202..3ae2c00 100644 (file)
@@ -201,7 +201,8 @@ void start_new_tl_epoch(struct drbd_connection *connection)
 void complete_master_bio(struct drbd_device *device,
                struct bio_and_error *m)
 {
-       bio_endio(m->bio, m->error);
+       m->bio->bi_error = m->error;
+       bio_endio(m->bio);
        dec_ap_bio(device);
 }
 
@@ -1153,12 +1154,12 @@ drbd_submit_req_private_bio(struct drbd_request *req)
                                      rw == WRITE ? DRBD_FAULT_DT_WR
                                    : rw == READ  ? DRBD_FAULT_DT_RD
                                    :               DRBD_FAULT_DT_RA))
-                       bio_endio(bio, -EIO);
+                       bio_io_error(bio);
                else
                        generic_make_request(bio);
                put_ldev(device);
        } else
-               bio_endio(bio, -EIO);
+               bio_io_error(bio);
 }
 
 static void drbd_queue_write(struct drbd_device *device, struct drbd_request *req)
@@ -1191,7 +1192,8 @@ drbd_request_prepare(struct drbd_device *device, struct bio *bio, unsigned long
                /* only pass the error to the upper layers.
                 * if user cannot handle io errors, that's not our business. */
                drbd_err(device, "could not kmalloc() req\n");
-               bio_endio(bio, -ENOMEM);
+               bio->bi_error = -ENOMEM;
+               bio_endio(bio);
                return ERR_PTR(-ENOMEM);
        }
        req->start_jif = start_jif;
@@ -1492,11 +1494,13 @@ void do_submit(struct work_struct *ws)
        }
 }
 
-void drbd_make_request(struct request_queue *q, struct bio *bio)
+blk_qc_t drbd_make_request(struct request_queue *q, struct bio *bio)
 {
        struct drbd_device *device = (struct drbd_device *) q->queuedata;
        unsigned long start_jif;
 
+       blk_queue_split(q, &bio, q->bio_split);
+
        start_jif = jiffies;
 
        /*
@@ -1506,41 +1510,7 @@ void drbd_make_request(struct request_queue *q, struct bio *bio)
 
        inc_ap_bio(device);
        __drbd_make_request(device, bio, start_jif);
-}
-
-/* This is called by bio_add_page().
- *
- * q->max_hw_sectors and other global limits are already enforced there.
- *
- * We need to call down to our lower level device,
- * in case it has special restrictions.
- *
- * We also may need to enforce configured max-bio-bvecs limits.
- *
- * As long as the BIO is empty we have to allow at least one bvec,
- * regardless of size and offset, so no need to ask lower levels.
- */
-int drbd_merge_bvec(struct request_queue *q, struct bvec_merge_data *bvm, struct bio_vec *bvec)
-{
-       struct drbd_device *device = (struct drbd_device *) q->queuedata;
-       unsigned int bio_size = bvm->bi_size;
-       int limit = DRBD_MAX_BIO_SIZE;
-       int backing_limit;
-
-       if (bio_size && get_ldev(device)) {
-               unsigned int max_hw_sectors = queue_max_hw_sectors(q);
-               struct request_queue * const b =
-                       device->ldev->backing_bdev->bd_disk->queue;
-               if (b->merge_bvec_fn) {
-                       bvm->bi_bdev = device->ldev->backing_bdev;
-                       backing_limit = b->merge_bvec_fn(b, bvm, bvec);
-                       limit = min(limit, backing_limit);
-               }
-               put_ldev(device);
-               if ((limit >> 9) > max_hw_sectors)
-                       limit = max_hw_sectors << 9;
-       }
-       return limit;
+       return BLK_QC_T_NONE;
 }
 
 void request_timer_fn(unsigned long data)