From patchwork Fri Nov 20 07:14:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiyoshi Ueda X-Patchwork-Id: 61594 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 nAK7FFON009069 for ; Fri, 20 Nov 2009 07:15:15 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 BB0DF6196EA; Fri, 20 Nov 2009 02:14:58 -0500 (EST) Received: from int-mx05.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 nAK7Evne018665 for ; Fri, 20 Nov 2009 02:14:57 -0500 Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.13]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nAK7Ev8Q004651; Fri, 20 Nov 2009 02:14:57 -0500 Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAK7EfjE014874; Fri, 20 Nov 2009 02:14:41 -0500 Received: from mailgate3.nec.co.jp ([10.7.69.195]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id nAK7Eca0017903; Fri, 20 Nov 2009 16:14:38 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id nAK7EcO00165; Fri, 20 Nov 2009 16:14:38 +0900 (JST) Received: from mail03.kamome.nec.co.jp (mail03.kamome.nec.co.jp [10.25.43.7]) by mailsv.nec.co.jp (8.13.8/8.13.4) with ESMTP id nAK7Ebqc017574; Fri, 20 Nov 2009 16:14:37 +0900 (JST) Received: from shintaro.jp.nec.com ([10.26.220.11] [10.26.220.11]) by mail02.kamome.nec.co.jp with ESMTP id BT-MMP-351193; Fri, 20 Nov 2009 16:14:05 +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:14:05 +0900 Message-ID: <4B0641BD.6090104@ct.jp.nec.com> Date: Fri, 20 Nov 2009 16:14:05 +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.18 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.13 X-loop: dm-devel@redhat.com Cc: device-mapper development Subject: [dm-devel] [PATCH 3/4] dm: export suspended state 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.c =================================================================== --- 2.6.32-rc7.orig/drivers/md/dm.c +++ 2.6.32-rc7/drivers/md/dm.c @@ -2676,6 +2676,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: 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,6 +235,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); union map_info *dm_get_mapinfo(struct bio *bio); union map_info *dm_get_rq_mapinfo(struct request *rq);