diff options
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r-- | drivers/md/dm.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index aa4e2aa86d49..d21e1284604f 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -635,8 +635,10 @@ static void dec_pending(struct dm_io *io, int error) | |||
635 | if (!md->barrier_error && io_error != -EOPNOTSUPP) | 635 | if (!md->barrier_error && io_error != -EOPNOTSUPP) |
636 | md->barrier_error = io_error; | 636 | md->barrier_error = io_error; |
637 | end_io_acct(io); | 637 | end_io_acct(io); |
638 | free_io(md, io); | ||
638 | } else { | 639 | } else { |
639 | end_io_acct(io); | 640 | end_io_acct(io); |
641 | free_io(md, io); | ||
640 | 642 | ||
641 | if (io_error != DM_ENDIO_REQUEUE) { | 643 | if (io_error != DM_ENDIO_REQUEUE) { |
642 | trace_block_bio_complete(md->queue, bio); | 644 | trace_block_bio_complete(md->queue, bio); |
@@ -644,8 +646,6 @@ static void dec_pending(struct dm_io *io, int error) | |||
644 | bio_endio(bio, io_error); | 646 | bio_endio(bio, io_error); |
645 | } | 647 | } |
646 | } | 648 | } |
647 | |||
648 | free_io(md, io); | ||
649 | } | 649 | } |
650 | } | 650 | } |
651 | 651 | ||
@@ -2618,18 +2618,19 @@ out: | |||
2618 | /*----------------------------------------------------------------- | 2618 | /*----------------------------------------------------------------- |
2619 | * Event notification. | 2619 | * Event notification. |
2620 | *---------------------------------------------------------------*/ | 2620 | *---------------------------------------------------------------*/ |
2621 | void dm_kobject_uevent(struct mapped_device *md, enum kobject_action action, | 2621 | int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action, |
2622 | unsigned cookie) | 2622 | unsigned cookie) |
2623 | { | 2623 | { |
2624 | char udev_cookie[DM_COOKIE_LENGTH]; | 2624 | char udev_cookie[DM_COOKIE_LENGTH]; |
2625 | char *envp[] = { udev_cookie, NULL }; | 2625 | char *envp[] = { udev_cookie, NULL }; |
2626 | 2626 | ||
2627 | if (!cookie) | 2627 | if (!cookie) |
2628 | kobject_uevent(&disk_to_dev(md->disk)->kobj, action); | 2628 | return kobject_uevent(&disk_to_dev(md->disk)->kobj, action); |
2629 | else { | 2629 | else { |
2630 | snprintf(udev_cookie, DM_COOKIE_LENGTH, "%s=%u", | 2630 | snprintf(udev_cookie, DM_COOKIE_LENGTH, "%s=%u", |
2631 | DM_COOKIE_ENV_VAR_NAME, cookie); | 2631 | DM_COOKIE_ENV_VAR_NAME, cookie); |
2632 | kobject_uevent_env(&disk_to_dev(md->disk)->kobj, action, envp); | 2632 | return kobject_uevent_env(&disk_to_dev(md->disk)->kobj, |
2633 | action, envp); | ||
2633 | } | 2634 | } |
2634 | } | 2635 | } |
2635 | 2636 | ||
@@ -2699,23 +2700,13 @@ int dm_suspended_md(struct mapped_device *md) | |||
2699 | 2700 | ||
2700 | int dm_suspended(struct dm_target *ti) | 2701 | int dm_suspended(struct dm_target *ti) |
2701 | { | 2702 | { |
2702 | struct mapped_device *md = dm_table_get_md(ti->table); | 2703 | return dm_suspended_md(dm_table_get_md(ti->table)); |
2703 | int r = dm_suspended_md(md); | ||
2704 | |||
2705 | dm_put(md); | ||
2706 | |||
2707 | return r; | ||
2708 | } | 2704 | } |
2709 | EXPORT_SYMBOL_GPL(dm_suspended); | 2705 | EXPORT_SYMBOL_GPL(dm_suspended); |
2710 | 2706 | ||
2711 | int dm_noflush_suspending(struct dm_target *ti) | 2707 | int dm_noflush_suspending(struct dm_target *ti) |
2712 | { | 2708 | { |
2713 | struct mapped_device *md = dm_table_get_md(ti->table); | 2709 | return __noflush_suspending(dm_table_get_md(ti->table)); |
2714 | int r = __noflush_suspending(md); | ||
2715 | |||
2716 | dm_put(md); | ||
2717 | |||
2718 | return r; | ||
2719 | } | 2710 | } |
2720 | EXPORT_SYMBOL_GPL(dm_noflush_suspending); | 2711 | EXPORT_SYMBOL_GPL(dm_noflush_suspending); |
2721 | 2712 | ||