X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fmd%2Fdm-mpath.c;h=d6ca9d0a6fd1cbd5fd8f223e9e2b901092e631f3;hb=dc8a7b11aa68d6795a46e0a42ce92220d1a6f0cd;hp=3aa0135069672d8fe7f3ed4c6e743d969478c95f;hpb=6bfe5c9d6f4dcaa998f67e691359cf7b1c4b443d;p=linux-2.6-omap-h63xx.git diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 3aa01350696..d6ca9d0a6fd 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -83,7 +83,7 @@ struct multipath { struct work_struct trigger_event; /* - * We must use a mempool of mpath_io structs so that we + * We must use a mempool of dm_mpath_io structs so that we * can resubmit bios on error. */ mempool_t *mpio_pool; @@ -92,7 +92,7 @@ struct multipath { /* * Context information attached to each bio we process. */ -struct mpath_io { +struct dm_mpath_io { struct pgpath *pgpath; struct dm_bio_details details; }; @@ -122,7 +122,7 @@ static struct pgpath *alloc_pgpath(void) return pgpath; } -static inline void free_pgpath(struct pgpath *pgpath) +static void free_pgpath(struct pgpath *pgpath) { kfree(pgpath); } @@ -299,8 +299,8 @@ static int __must_push_back(struct multipath *m) dm_noflush_suspending(m->ti)); } -static int map_io(struct multipath *m, struct bio *bio, struct mpath_io *mpio, - unsigned was_queued) +static int map_io(struct multipath *m, struct bio *bio, + struct dm_mpath_io *mpio, unsigned was_queued) { int r = DM_MAPIO_REMAPPED; unsigned long flags; @@ -374,7 +374,7 @@ static void dispatch_queued_ios(struct multipath *m) int r; unsigned long flags; struct bio *bio = NULL, *next; - struct mpath_io *mpio; + struct dm_mpath_io *mpio; union map_info *info; spin_lock_irqsave(&m->lock, flags); @@ -668,6 +668,9 @@ static int parse_hw_handler(struct arg_set *as, struct multipath *m) return -EINVAL; } + m->hw_handler.md = dm_table_get_md(ti->table); + dm_put(m->hw_handler.md); + r = hwht->create(&m->hw_handler, hw_argc - 1, as->argv); if (r) { dm_put_hw_handler(hwht); @@ -792,12 +795,9 @@ static int multipath_map(struct dm_target *ti, struct bio *bio, union map_info *map_context) { int r; - struct mpath_io *mpio; + struct dm_mpath_io *mpio; struct multipath *m = (struct multipath *) ti->private; - if (bio_barrier(bio)) - return -EOPNOTSUPP; - mpio = mempool_alloc(m->mpio_pool, GFP_NOIO); dm_bio_record(&mpio->details, bio); @@ -1011,7 +1011,7 @@ void dm_pg_init_complete(struct dm_path *path, unsigned err_flags) * end_io handling */ static int do_end_io(struct multipath *m, struct bio *bio, - int error, struct mpath_io *mpio) + int error, struct dm_mpath_io *mpio) { struct hw_handler *hwh = &m->hw_handler; unsigned err_flags = MP_FAIL_PATH; /* Default behavior */ @@ -1072,8 +1072,8 @@ static int do_end_io(struct multipath *m, struct bio *bio, static int multipath_end_io(struct dm_target *ti, struct bio *bio, int error, union map_info *map_context) { - struct multipath *m = (struct multipath *) ti->private; - struct mpath_io *mpio = (struct mpath_io *) map_context->ptr; + struct multipath *m = ti->private; + struct dm_mpath_io *mpio = map_context->ptr; struct pgpath *pgpath = mpio->pgpath; struct path_selector *ps; int r; @@ -1343,22 +1343,20 @@ static int __init dm_multipath_init(void) int r; /* allocate a slab for the dm_ios */ - _mpio_cache = kmem_cache_create("dm_mpath", sizeof(struct mpath_io), - 0, 0, NULL, NULL); + _mpio_cache = KMEM_CACHE(dm_mpath_io, 0); if (!_mpio_cache) return -ENOMEM; r = dm_register_target(&multipath_target); if (r < 0) { - DMERR("%s: register failed %d", multipath_target.name, r); + DMERR("register failed %d", r); kmem_cache_destroy(_mpio_cache); return -EINVAL; } kmultipathd = create_workqueue("kmpathd"); if (!kmultipathd) { - DMERR("%s: failed to create workqueue kmpathd", - multipath_target.name); + DMERR("failed to create workqueue kmpathd"); dm_unregister_target(&multipath_target); kmem_cache_destroy(_mpio_cache); return -ENOMEM; @@ -1379,8 +1377,7 @@ static void __exit dm_multipath_exit(void) r = dm_unregister_target(&multipath_target); if (r < 0) - DMERR("%s: target unregister failed %d", - multipath_target.name, r); + DMERR("target unregister failed %d", r); kmem_cache_destroy(_mpio_cache); }