~ubuntu-branches/ubuntu/quantal/linux-ti-omap4/quantal

« back to all changes in this revision

Viewing changes to drivers/md/dm-io.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Ubuntu: 3.2.0-19.31, Ubuntu: 3.2.0-19.30
  • Date: 2012-03-21 15:23:51 UTC
  • Revision ID: package-import@ubuntu.com-20120321152351-ya52awpl9cmqlwrs
Tags: 3.2.0-1410.13
[ Paolo Pisati ]

* rebased on Ubuntu-3.2.0-19.31

[ Ubuntu: 3.2.0-19.31 ]

* d-i: Add dm-multipath and scsi device handlers
  - LP: #959749
* d-i: Move multipath modules into their own udeb
  - LP: #598251, #959749
* [Config] Auto-detect do_tools setting
* [Config] correctly specify CROSS_COMPILE for tools build
* [Config] CONFIG_DRM_PSB_CDV=n
* Rebase to v3.2.12
* powerpc/pmac: Fix SMP kernels on pre-core99 UP machines
  - LP: #959959
* rebase to v3.2.12

[ Ubuntu: 3.2.0-19.30 ]

* [Config] Fix typeo in the Hyper-V module names
* [Config] Move kernels to "Section: kernel"
  - LP: #499557
* SAUCE: AppArmor: Add ability to load extended policy
* SAUCE: AppArmor: Add the ability to mediate mount
* SAUCE: AppArmor: Add profile introspection file to interface
* SAUCE: AppArmor: basic networking rules
* [Config] Disable CONFIG_SECURITY_TOMOYO_OMIT_USERSPACE_LOADER
  - LP: #952035
* Rebase to v3.2.10
* [Config] Update configs after rebase to v3.2.10
* Rebase to v3.2.11
* [Config] Disable CONFIG_STUB_POULSBO
  - LP: #899244
* [Config] Add CONFIG_DRM_PSB check to enforcer
  - LP: #899244
* [Config] Drop non-SMP powerpc
* net/hyperv: Use the built-in macro KBUILD_MODNAME for this driver
* x86: Derandom delay_tsc for 64 bit
* Bluetooth: Fix l2cap conn failures for ssp devices
  - LP: #872044
* KVM: x86: extend "struct x86_emulate_ops" with "get_cpuid"
  - LP: #917842
  - CVE-2012-0045
* KVM: x86: fix missing checks in syscall emulation
  - LP: #917842
  - CVE-2012-0045
* rebase to v3.2.11
* rebase to v3.2.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
296
296
        unsigned offset;
297
297
        unsigned num_bvecs;
298
298
        sector_t remaining = where->count;
 
299
        struct request_queue *q = bdev_get_queue(where->bdev);
 
300
        sector_t discard_sectors;
299
301
 
300
302
        /*
301
303
         * where->count may be zero if rw holds a flush and we need to
305
307
                /*
306
308
                 * Allocate a suitably sized-bio.
307
309
                 */
308
 
                num_bvecs = dm_sector_div_up(remaining,
309
 
                                             (PAGE_SIZE >> SECTOR_SHIFT));
310
 
                num_bvecs = min_t(int, bio_get_nr_vecs(where->bdev), num_bvecs);
 
310
                if (rw & REQ_DISCARD)
 
311
                        num_bvecs = 1;
 
312
                else
 
313
                        num_bvecs = min_t(int, bio_get_nr_vecs(where->bdev),
 
314
                                          dm_sector_div_up(remaining, (PAGE_SIZE >> SECTOR_SHIFT)));
 
315
 
311
316
                bio = bio_alloc_bioset(GFP_NOIO, num_bvecs, io->client->bios);
312
317
                bio->bi_sector = where->sector + (where->count - remaining);
313
318
                bio->bi_bdev = where->bdev;
315
320
                bio->bi_destructor = dm_bio_destructor;
316
321
                store_io_and_region_in_bio(bio, io, region);
317
322
 
318
 
                /*
319
 
                 * Try and add as many pages as possible.
320
 
                 */
321
 
                while (remaining) {
 
323
                if (rw & REQ_DISCARD) {
 
324
                        discard_sectors = min_t(sector_t, q->limits.max_discard_sectors, remaining);
 
325
                        bio->bi_size = discard_sectors << SECTOR_SHIFT;
 
326
                        remaining -= discard_sectors;
 
327
                } else while (remaining) {
 
328
                        /*
 
329
                         * Try and add as many pages as possible.
 
330
                         */
322
331
                        dp->get_page(dp, &page, &len, &offset);
323
332
                        len = min(len, to_bytes(remaining));
324
333
                        if (!bio_add_page(bio, page, len, offset))