From patchwork Fri Nov 20 07:12:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiyoshi Ueda X-Patchwork-Id: 61589 X-Patchwork-Delegate: agk@redhat.com Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAK7DSmX008843 for ; Fri, 20 Nov 2009 07:13:28 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id B78CA61A251; Fri, 20 Nov 2009 02:13:27 -0500 (EST) Received: from int-mx04.intmail.prod.int.phx2.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id nAK7DRol018563 for ; Fri, 20 Nov 2009 02:13:27 -0500 Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.6]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nAK7DQPv016250; Fri, 20 Nov 2009 02:13:26 -0500 Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAK7DAHr025852; Fri, 20 Nov 2009 02:13:11 -0500 Received: from mailgate4.nec.co.jp ([10.7.69.184]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id nAK7Cwfb027937; Fri, 20 Nov 2009 16:12:58 +0900 (JST) Received: (from root@localhost) by mailgate4.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id nAK7Cw407304; Fri, 20 Nov 2009 16:12:58 +0900 (JST) Received: from mail02.kamome.nec.co.jp (mail02.kamome.nec.co.jp [10.25.43.5]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id nAK7CcIo005887; Fri, 20 Nov 2009 16:12:58 +0900 (JST) Received: from yonosuke.jp.nec.com ([10.26.220.15] [10.26.220.15]) by mail02.kamome.nec.co.jp with ESMTP id BT-MMP-351734; Fri, 20 Nov 2009 16:12:11 +0900 Received: from elcondor.linux.bs1.fc.nec.co.jp ([10.34.125.195] [10.34.125.195]) by mail.jp.nec.com with ESMTP; Fri, 20 Nov 2009 16:12:11 +0900 Message-ID: <4B06414B.6080305@ct.jp.nec.com> Date: Fri, 20 Nov 2009 16:12:11 +0900 From: Kiyoshi Ueda User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: Alasdair Kergon , Mike Anderson References: <4B06408A.1080700@ct.jp.nec.com> In-Reply-To: <4B06408A.1080700@ct.jp.nec.com> X-RedHat-Spam-Score: 0 () X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.6 X-loop: dm-devel@redhat.com Cc: device-mapper development Subject: [dm-devel] [PATCH 2/4] dm: rename dm_suspended() to dm_suspended_md() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com Index: 2.6.32-rc7/drivers/md/dm-ioctl.c =================================================================== --- 2.6.32-rc7.orig/drivers/md/dm-ioctl.c +++ 2.6.32-rc7/drivers/md/dm-ioctl.c @@ -547,7 +547,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(disk_devt(disk)); @@ -795,7 +795,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) @@ -837,7 +837,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); @@ -853,7 +853,7 @@ static int do_resume(struct dm_ioctl *pa set_disk_ro(dm_disk(md), 1); } - if (dm_suspended(md)) + if (dm_suspended_md(md)) r = dm_resume(md); Index: 2.6.32-rc7/drivers/md/dm-sysfs.c =================================================================== --- 2.6.32-rc7.orig/drivers/md/dm-sysfs.c +++ 2.6.32-rc7/drivers/md/dm-sysfs.c @@ -59,7 +59,7 @@ static ssize_t dm_attr_uuid_show(struct static ssize_t dm_attr_suspended_show(struct mapped_device *md, char *buf) { - sprintf(buf, "%d\n", dm_suspended(md)); + sprintf(buf, "%d\n", dm_suspended_md(md)); return strlen(buf); } Index: 2.6.32-rc7/drivers/md/dm.c =================================================================== --- 2.6.32-rc7.orig/drivers/md/dm.c +++ 2.6.32-rc7/drivers/md/dm.c @@ -415,7 +415,7 @@ static int dm_blk_ioctl(struct block_dev tgt = dm_table_get_target(map, 0); - if (dm_suspended(md)) { + if (dm_suspended_md(md)) { r = -EAGAIN; goto out; } @@ -2176,7 +2176,7 @@ void dm_put(struct mapped_device *md) MINOR(disk_devt(dm_disk(md)))); 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); } @@ -2374,7 +2374,7 @@ int dm_swap_table(struct mapped_device * mutex_lock(&md->suspend_lock); /* device must be suspended */ - if (!dm_suspended(md)) + if (!dm_suspended_md(md)) goto out; r = dm_calculate_queue_limits(table, &limits); @@ -2453,7 +2453,7 @@ int dm_suspend(struct mapped_device *md, mutex_lock(&md->suspend_lock); - if (dm_suspended(md)) { + if (dm_suspended_md(md)) { r = -EINVAL; goto out_unlock; } @@ -2560,7 +2560,7 @@ int dm_resume(struct mapped_device *md) struct dm_table *map = NULL; mutex_lock(&md->suspend_lock); - if (!dm_suspended(md)) + if (!dm_suspended_md(md)) goto out; map = dm_get_live_table(md); @@ -2671,7 +2671,7 @@ struct mapped_device *dm_get_from_kobjec return md; } -int dm_suspended(struct mapped_device *md) +int dm_suspended_md(struct mapped_device *md) { return test_bit(DMF_SUSPENDED, &md->flags); } Index: 2.6.32-rc7/drivers/md/dm.h =================================================================== --- 2.6.32-rc7.orig/drivers/md/dm.h +++ 2.6.32-rc7/drivers/md/dm.h @@ -94,6 +94,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: 2.6.32-rc7/include/linux/device-mapper.h =================================================================== --- 2.6.32-rc7.orig/include/linux/device-mapper.h +++ 2.6.32-rc7/include/linux/device-mapper.h @@ -235,7 +235,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); union map_info *dm_get_mapinfo(struct bio *bio); union map_info *dm_get_rq_mapinfo(struct request *rq);