Merge git://git.infradead.org/battery-2.6
[deliverable/linux.git] / drivers / md / multipath.c
index 237fe3fd235c86bd7648fedee32992f2660fb2df..d2d3fd54cc681184cab146bf90ddc000f3b706de 100644 (file)
@@ -90,7 +90,7 @@ static void multipath_end_request(struct bio *bio, int error)
 
        if (uptodate)
                multipath_end_bh_io(mp_bh, 0);
-       else if (!bio_rw_ahead(bio)) {
+       else if (!bio_rw_flagged(bio, BIO_RW_AHEAD)) {
                /*
                 * oops, IO error:
                 */
@@ -144,12 +144,13 @@ static int multipath_make_request (struct request_queue *q, struct bio * bio)
        const int rw = bio_data_dir(bio);
        int cpu;
 
-       if (unlikely(bio_barrier(bio))) {
+       if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) {
                bio_endio(bio, -EOPNOTSUPP);
                return 0;
        }
 
        mp_bh = mempool_alloc(conf->pool, GFP_NOIO);
+       memset(mp_bh, 0, sizeof(*mp_bh));
 
        mp_bh->master_bio = bio;
        mp_bh->mddev = mddev;
@@ -313,6 +314,7 @@ static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
                        set_bit(In_sync, &rdev->flags);
                        rcu_assign_pointer(p->rdev, rdev);
                        err = 0;
+                       md_integrity_add_rdev(rdev, mddev);
                        break;
                }
 
@@ -345,7 +347,9 @@ static int multipath_remove_disk(mddev_t *mddev, int number)
                        /* lost the race, try later */
                        err = -EBUSY;
                        p->rdev = rdev;
+                       goto abort;
                }
+               md_integrity_register(mddev);
        }
 abort:
 
@@ -490,7 +494,7 @@ static int multipath_run (mddev_t *mddev)
        }
        mddev->degraded = conf->raid_disks - conf->working_disks;
 
-       conf->pool = mempool_create_kzalloc_pool(NR_RESERVED_BUFS,
+       conf->pool = mempool_create_kmalloc_pool(NR_RESERVED_BUFS,
                                                 sizeof(struct multipath_bh));
        if (conf->pool == NULL) {
                printk(KERN_ERR 
@@ -519,7 +523,7 @@ static int multipath_run (mddev_t *mddev)
        mddev->queue->unplug_fn = multipath_unplug;
        mddev->queue->backing_dev_info.congested_fn = multipath_congested;
        mddev->queue->backing_dev_info.congested_data = mddev;
-
+       md_integrity_register(mddev);
        return 0;
 
 out_free_conf:
This page took 0.025603 seconds and 5 git commands to generate.