From 64dbce580d5a7e89e8de20b91f80c7267cdad91d Mon Sep 17 00:00:00 2001 From: Kiyoshi Ueda Date: Thu, 10 Dec 2009 23:52:27 +0000 Subject: [RHEL5.7 PATCH] dm: export suspended state to targets Upstream commit 64dbce580d5a7e89e8de20b91f80c7267cdad91d Author: Kiyoshi Ueda Date: Thu Dec 10 23:52:27 2009 +0000 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 Signed-off-by: Jun'ichi Nomura Cc: Mike Anderson Signed-off-by: Alasdair G Kergon --- drivers/md/dm.c | 11 +++++++++++ include/linux/device-mapper.h | 1 + 2 files changed, 12 insertions(+) Index: linux-rhel5/drivers/md/dm.c =================================================================== --- linux-rhel5.orig/drivers/md/dm.c +++ linux-rhel5/drivers/md/dm.c @@ -1619,6 +1619,17 @@ int dm_suspended_md(struct mapped_device return test_bit(DMF_SUSPENDED, &md->flags); } +int dm_suspended(struct dm_target *ti) +{ + struct mapped_device *md = dm_table_get_md(ti->table); + int r = dm_suspended_md(md); + + dm_put(md); + + return r; +} +EXPORT_SYMBOL_GPL(dm_suspended); + int dm_noflush_suspending(struct dm_target *ti) { struct mapped_device *md = dm_table_get_md(ti->table); Index: linux-rhel5/include/linux/device-mapper.h =================================================================== --- linux-rhel5.orig/include/linux/device-mapper.h +++ linux-rhel5/include/linux/device-mapper.h @@ -186,6 +186,7 @@ void dm_uevent_add(struct mapped_device const char *dm_device_name(struct mapped_device *md); int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid); struct gendisk *dm_disk(struct mapped_device *md); +int dm_suspended(struct dm_target *ti); int dm_noflush_suspending(struct dm_target *ti); /*