From 4f186f8bbfa92bf1a2b39f7a8674348bfdba9437 Mon Sep 17 00:00:00 2001 From: Kiyoshi Ueda Date: Thu, 10 Dec 2009 23:52:26 +0000 Subject: [RHEL5.7 PATCH] dm: rename dm_suspended to dm_suspended_md Upstream commit 4f186f8bbfa92bf1a2b39f7a8674348bfdba9437 Author: Kiyoshi Ueda Date: Thu Dec 10 23:52:26 2009 +0000 dm: rename dm_suspended to dm_suspended_md This patch renames dm_suspended() to dm_suspended_md() and keeps it internal to dm. No functional change. Signed-off-by: Kiyoshi Ueda Signed-off-by: Jun'ichi Nomura Cc: Mike Anderson Signed-off-by: Alasdair G Kergon --- drivers/md/dm-ioctl.c | 8 ++++---- drivers/md/dm.c | 12 ++++++------ drivers/md/dm.h | 5 +++++ include/linux/device-mapper.h | 1 - 4 files changed, 15 insertions(+), 11 deletions(-) Index: linux-rhel5/drivers/md/dm-ioctl.c =================================================================== --- linux-rhel5.orig/drivers/md/dm-ioctl.c +++ linux-rhel5/drivers/md/dm-ioctl.c @@ -577,7 +577,7 @@ static int __dev_status(struct mapped_de param->flags &= ~(DM_SUSPEND_FLAG | DM_READONLY_FLAG | DM_ACTIVE_PRESENT_FLAG); - if (dm_suspended(md)) + if (dm_suspended_md(md)) param->flags |= DM_SUSPEND_FLAG; param->dev = huge_encode_dev(MKDEV(disk->major, disk->first_minor)); @@ -834,7 +834,7 @@ static int do_suspend(struct dm_ioctl *p if (param->flags & DM_NOFLUSH_FLAG) suspend_flags |= DM_SUSPEND_NOFLUSH_FLAG; - if (!dm_suspended(md)) + if (!dm_suspended_md(md)) r = dm_suspend(md, suspend_flags); if (!r) @@ -876,7 +876,7 @@ static int do_resume(struct dm_ioctl *pa suspend_flags &= ~DM_SUSPEND_LOCKFS_FLAG; if (param->flags & DM_NOFLUSH_FLAG) suspend_flags |= DM_SUSPEND_NOFLUSH_FLAG; - if (!dm_suspended(md)) + if (!dm_suspended_md(md)) dm_suspend(md, suspend_flags); r = dm_swap_table(md, new_map); @@ -894,7 +894,7 @@ static int do_resume(struct dm_ioctl *pa dm_table_put(new_map); } - if (dm_suspended(md)) + if (dm_suspended_md(md)) r = dm_resume(md); if (!r) Index: linux-rhel5/drivers/md/dm.c =================================================================== --- linux-rhel5.orig/drivers/md/dm.c +++ linux-rhel5/drivers/md/dm.c @@ -334,7 +334,7 @@ static int dm_blk_ioctl(struct inode *in tgt = dm_table_get_target(map, 0); - if (dm_suspended(md)) { + if (dm_suspended_md(md)) { r = -EAGAIN; goto out; } @@ -1300,7 +1300,7 @@ void dm_put(struct mapped_device *md) idr_replace(&_minor_idr, MINOR_ALLOCED, dm_disk(md)->first_minor); set_bit(DMF_FREEING, &md->flags); spin_unlock(&_minor_lock); - if (!dm_suspended(md)) { + if (!dm_suspended_md(md)) { dm_table_presuspend_targets(map); dm_table_postsuspend_targets(map); } @@ -1336,7 +1336,7 @@ int dm_swap_table(struct mapped_device * down(&md->suspend_lock); /* device must be suspended */ - if (!dm_suspended(md)) + if (!dm_suspended_md(md)) goto out; /* without bdev, the device size cannot be changed */ @@ -1406,7 +1406,7 @@ int dm_suspend(struct mapped_device *md, down(&md->suspend_lock); - if (dm_suspended(md)) + if (dm_suspended_md(md)) goto out_unlock; map = dm_get_live_table(md); @@ -1536,7 +1536,7 @@ int dm_resume(struct mapped_device *md) struct dm_table *map = NULL; down(&md->suspend_lock); - if (!dm_suspended(md)) + if (!dm_suspended_md(md)) goto out; map = dm_get_live_table(md); @@ -1614,7 +1614,7 @@ struct gendisk *dm_disk(struct mapped_de } EXPORT_SYMBOL_GPL(dm_disk); -int dm_suspended(struct mapped_device *md) +int dm_suspended_md(struct mapped_device *md) { return test_bit(DMF_SUSPENDED, &md->flags); } Index: linux-rhel5/drivers/md/dm.h =================================================================== --- linux-rhel5.orig/drivers/md/dm.h +++ linux-rhel5/drivers/md/dm.h @@ -84,6 +84,11 @@ int dm_split_args(int *argc, char ***arg int dm_deleting_md(struct mapped_device *md); /* + * Is this mapped_device suspended? + */ +int dm_suspended_md(struct mapped_device *md); + +/* * The device-mapper can be driven through one of two interfaces; * ioctl or filesystem, depending which patch you have applied. */ Index: linux-rhel5/include/linux/device-mapper.h =================================================================== --- linux-rhel5.orig/include/linux/device-mapper.h +++ linux-rhel5/include/linux/device-mapper.h @@ -186,7 +186,6 @@ 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 mapped_device *md); int dm_noflush_suspending(struct dm_target *ti); /*