diff options
author | Kiyoshi Ueda <k-ueda@ct.jp.nec.com> | 2009-12-10 18:52:27 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-12-10 18:52:27 -0500 |
commit | 64dbce580d5a7e89e8de20b91f80c7267cdad91d (patch) | |
tree | 9d8a8bb8afd9d7b856d90abd7c5c35137547d09a | |
parent | 4f186f8bbfa92bf1a2b39f7a8674348bfdba9437 (diff) |
dm: export suspended state to targets
This patch adds the exported dm_suspended() function so that targets
can check whether or not they are suspended.
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Mike Anderson <andmike@linux.vnet.ibm.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
-rw-r--r-- | drivers/md/dm.c | 11 | ||||
-rw-r--r-- | include/linux/device-mapper.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index e0702bf37935..3167480b532c 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -2684,6 +2684,17 @@ int dm_suspended_md(struct mapped_device *md) | |||
2684 | return test_bit(DMF_SUSPENDED, &md->flags); | 2684 | return test_bit(DMF_SUSPENDED, &md->flags); |
2685 | } | 2685 | } |
2686 | 2686 | ||
2687 | int dm_suspended(struct dm_target *ti) | ||
2688 | { | ||
2689 | struct mapped_device *md = dm_table_get_md(ti->table); | ||
2690 | int r = dm_suspended_md(md); | ||
2691 | |||
2692 | dm_put(md); | ||
2693 | |||
2694 | return r; | ||
2695 | } | ||
2696 | EXPORT_SYMBOL_GPL(dm_suspended); | ||
2697 | |||
2687 | int dm_noflush_suspending(struct dm_target *ti) | 2698 | int dm_noflush_suspending(struct dm_target *ti) |
2688 | { | 2699 | { |
2689 | struct mapped_device *md = dm_table_get_md(ti->table); | 2700 | struct mapped_device *md = dm_table_get_md(ti->table); |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index fca0d31bbf2d..d4c9c0b88adc 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -235,6 +235,7 @@ void dm_uevent_add(struct mapped_device *md, struct list_head *elist); | |||
235 | const char *dm_device_name(struct mapped_device *md); | 235 | const char *dm_device_name(struct mapped_device *md); |
236 | int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid); | 236 | int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid); |
237 | struct gendisk *dm_disk(struct mapped_device *md); | 237 | struct gendisk *dm_disk(struct mapped_device *md); |
238 | int dm_suspended(struct dm_target *ti); | ||
238 | int dm_noflush_suspending(struct dm_target *ti); | 239 | int dm_noflush_suspending(struct dm_target *ti); |
239 | union map_info *dm_get_mapinfo(struct bio *bio); | 240 | union map_info *dm_get_mapinfo(struct bio *bio); |
240 | union map_info *dm_get_rq_mapinfo(struct request *rq); | 241 | union map_info *dm_get_rq_mapinfo(struct request *rq); |