]> err.no Git - linux-2.6/blobdiff - drivers/md/multipath.c
[ARM] 3008/1: the exception table is not read-only
[linux-2.6] / drivers / md / multipath.c
index 1891e4930dcc0799ba35fb409b07d3a2d9565bb8..1151c3ed300677e2be0fbed012ab27052527afb6 100644 (file)
@@ -38,7 +38,7 @@
 static mdk_personality_t multipath_personality;
 
 
-static void *mp_pool_alloc(unsigned int __nocast gfp_flags, void *data)
+static void *mp_pool_alloc(gfp_t gfp_flags, void *data)
 {
        struct multipath_bh *mpb;
        mpb = kmalloc(sizeof(*mpb), gfp_flags);
@@ -103,7 +103,8 @@ static void multipath_end_bh_io (struct multipath_bh *mp_bh, int err)
        mempool_free(mp_bh, conf->pool);
 }
 
-int multipath_end_request(struct bio *bio, unsigned int bytes_done, int error)
+static int multipath_end_request(struct bio *bio, unsigned int bytes_done,
+                                int error)
 {
        int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct multipath_bh * mp_bh = (struct multipath_bh *)(bio->bi_private);
@@ -168,6 +169,11 @@ static int multipath_make_request (request_queue_t *q, struct bio * bio)
        struct multipath_bh * mp_bh;
        struct multipath_info *multipath;
 
+       if (unlikely(bio_barrier(bio))) {
+               bio_endio(bio, bio->bi_size, -EOPNOTSUPP);
+               return 0;
+       }
+
        mp_bh = mempool_alloc(conf->pool, GFP_NOIO);
 
        mp_bh->master_bio = bio;
@@ -461,10 +467,6 @@ static int multipath_run (mddev_t *mddev)
        }
        memset(conf->multipaths, 0, sizeof(struct multipath_info)*mddev->raid_disks);
 
-       mddev->queue->unplug_fn = multipath_unplug;
-
-       mddev->queue->issue_flush_fn = multipath_issue_flush;
-
        conf->working_disks = 0;
        ITERATE_RDEV(mddev,rdev,tmp) {
                disk_idx = rdev->raid_disk;
@@ -527,13 +529,16 @@ static int multipath_run (mddev_t *mddev)
         * Ok, everything is just fine now
         */
        mddev->array_size = mddev->size;
+
+       mddev->queue->unplug_fn = multipath_unplug;
+       mddev->queue->issue_flush_fn = multipath_issue_flush;
+
        return 0;
 
 out_free_conf:
        if (conf->pool)
                mempool_destroy(conf->pool);
-       if (conf->multipaths)
-               kfree(conf->multipaths);
+       kfree(conf->multipaths);
        kfree(conf);
        mddev->private = NULL;
 out: