]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/md/dm.c
dm: support barriers on simple devices
[linux-2.6-omap-h63xx.git] / drivers / md / dm.c
index 4882ce7e88a33e974a071def5fb8496ed7cc3969..dd953b189f459288b576fedcd6b42a29931f76c9 100644 (file)
@@ -835,7 +835,11 @@ static int __split_bio(struct mapped_device *md, struct bio *bio)
        ci.map = dm_get_table(md);
        if (unlikely(!ci.map))
                return -EIO;
-
+       if (unlikely(bio_barrier(bio) && !dm_table_barrier_ok(ci.map))) {
+               dm_table_put(ci.map);
+               bio_endio(bio, -EOPNOTSUPP);
+               return 0;
+       }
        ci.md = md;
        ci.bio = bio;
        ci.io = alloc_io(md);
@@ -919,15 +923,6 @@ static int dm_request(struct request_queue *q, struct bio *bio)
        struct mapped_device *md = q->queuedata;
        int cpu;
 
-       /*
-        * There is no use in forwarding any barrier request since we can't
-        * guarantee it is (or can be) handled by the targets correctly.
-        */
-       if (unlikely(bio_barrier(bio))) {
-               bio_endio(bio, -EOPNOTSUPP);
-               return 0;
-       }
-
        down_read(&md->io_lock);
 
        cpu = part_stat_lock();