]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/md/dm-io.c
Merge branches 'topic/slob/cleanups', 'topic/slob/fixes', 'topic/slub/core', 'topic...
[linux-2.6-omap-h63xx.git] / drivers / md / dm-io.c
index a34338567a2a601c3cdbda72441d54299301f89a..36e2b5e46a6b644f0e9902b57b29c0666541d733 100644 (file)
@@ -292,6 +292,8 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where,
                                             (PAGE_SIZE >> SECTOR_SHIFT));
                num_bvecs = 1 + min_t(int, bio_get_nr_vecs(where->bdev),
                                      num_bvecs);
+               if (unlikely(num_bvecs > BIO_MAX_PAGES))
+                       num_bvecs = BIO_MAX_PAGES;
                bio = bio_alloc_bioset(GFP_NOIO, num_bvecs, io->client->bios);
                bio->bi_sector = where->sector + (where->count - remaining);
                bio->bi_bdev = where->bdev;
@@ -328,7 +330,7 @@ static void dispatch_io(int rw, unsigned int num_regions,
        struct dpages old_pages = *dp;
 
        if (sync)
-               rw |= (1 << BIO_RW_SYNC);
+               rw |= (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG);
 
        /*
         * For multiple regions we need to be careful to rewind