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

« back to all changes in this revision

Viewing changes to ubuntu/dm-raid4-5/dm-raid4-5.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1574
1574
 
1575
1575
        /* Create dm-io client context for IO stripes. */
1576
1576
        sc->dm_io_client =
1577
 
                dm_io_client_create((stripes > 32 ? 32 : stripes) *
1578
 
                                    rs->set.raid_devs *
1579
 
                                    chunk_pages(rs->set.io_size));
 
1577
                dm_io_client_create();
1580
1578
        if (IS_ERR(sc->dm_io_client))
1581
1579
                return PTR_ERR(sc->dm_io_client);
1582
1580
 
1583
1581
        /* FIXME: intermingeled with stripe cache initialization. */
1584
1582
        /* Create dm-io client context for recovery stripes. */
1585
1583
        rec->dm_io_client =
1586
 
                dm_io_client_create(rstripes * rs->set.raid_devs *
1587
 
                                    chunk_pages(rec->io_size));
 
1584
                dm_io_client_create();
1588
1585
        if (IS_ERR(rec->dm_io_client))
1589
1586
                return PTR_ERR(rec->dm_io_client);
1590
1587
 
3275
3272
        bio_list_merge_head(ios, &reject);
3276
3273
}
3277
3274
 
3278
 
/* Unplug: let any queued io role on the sets devices. */
3279
 
static void do_unplug(struct raid_set *rs)
3280
 
{
3281
 
        struct raid_dev *dev = rs->dev + rs->set.raid_devs;
3282
 
 
3283
 
        while (dev-- > rs->dev) {
3284
 
                /* Only call any device unplug function, if io got queued. */
3285
 
                if (TestClearDevIoQueued(dev))
3286
 
                        blk_unplug(bdev_get_queue(dev->dev->bdev));
3287
 
        }
3288
 
}
3289
 
 
3290
3275
/* Send an event in case we're getting too busy. */
3291
3276
static void do_busy_event(struct raid_set *rs)
3292
3277
{
3326
3311
        struct raid_set *rs = container_of(ws, struct raid_set,
3327
3312
                                           io.dws_do_raid.work);
3328
3313
        struct bio_list *ios = &rs->io.work, *ios_in = &rs->io.in;
 
3314
        struct blk_plug plug;
3329
3315
 
3330
3316
        /*
3331
3317
         * We always need to end io, so that ios can get errored in
3342
3328
        do_sc_resize(rs);
3343
3329
 
3344
3330
        /* Try to recover regions. */
 
3331
        blk_start_plug(&plug);
3345
3332
        do_recovery(rs);
3346
 
        do_unplug(rs);          /* Unplug the sets device queues. */
 
3333
        blk_finish_plug(&plug); /* Unplug the queue */
3347
3334
 
3348
3335
        /* Quickly grab all new ios queued and add them to the work list. */
3349
3336
        mutex_lock(&rs->io.in_lock);
3351
3338
        bio_list_init(ios_in);
3352
3339
        mutex_unlock(&rs->io.in_lock);
3353
3340
 
 
3341
        blk_start_plug(&plug);
3354
3342
        if (!bio_list_empty(ios))
3355
3343
                do_ios(rs, ios); /* Got ios to work into the cache. */
3356
3344
 
3357
3345
        do_flush(rs);           /* Flush any stripes on io list. */
3358
 
        do_unplug(rs);          /* Unplug the sets device queues. */
 
3346
        blk_finish_plug(&plug); /* Unplug the queue */
3359
3347
        do_busy_event(rs);      /* Check if we got too busy. */
3360
3348
}
3361
3349