From patchwork Mon Jan 4 08:28:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiyoshi Ueda X-Patchwork-Id: 70606 X-Patchwork-Delegate: agk@redhat.com Received: from mx01.util.phx2.redhat.com (mx1-phx2.redhat.com [209.132.183.26]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o048XPb4001616 for ; Mon, 4 Jan 2010 08:33:25 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx01.util.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o048VUVu000833; Mon, 4 Jan 2010 03:31:31 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o048TYx6013763 for ; Mon, 4 Jan 2010 03:29:34 -0500 Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.6]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o048TTdX010704; Mon, 4 Jan 2010 03:29:29 -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 o048TDCl024328; Mon, 4 Jan 2010 03:29:13 -0500 Received: from mailgate4.nec.co.jp ([10.7.69.184]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id o048TCDG016364; Mon, 4 Jan 2010 17:29:12 +0900 (JST) Received: (from root@localhost) by mailgate4.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id o048TCY18468; Mon, 4 Jan 2010 17:29:12 +0900 (JST) Received: from mail02.kamome.nec.co.jp (mail02.kamome.nec.co.jp [10.25.43.5]) by mailsv.nec.co.jp (8.13.8/8.13.4) with ESMTP id o048TBGe025020; Mon, 4 Jan 2010 17:29:11 +0900 (JST) Received: from shoin.jp.nec.com ([10.26.220.3] [10.26.220.3]) by mail02.kamome.nec.co.jp with ESMTP id BT-MMP-772607; Mon, 4 Jan 2010 17:28:14 +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; Mon, 4 Jan 2010 17:28:14 +0900 Message-ID: <4B41A699.5080802@ct.jp.nec.com> Date: Mon, 04 Jan 2010 17:28:09 +0900 From: Kiyoshi Ueda User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: Alasdair Kergon , device-mapper development X-RedHat-Spam-Score: 0 () X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.6 X-loop: dm-devel@redhat.com Subject: [dm-devel] [RFC PATCH] dm: Remove dm_get() from dm_table_get_md() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 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.33-rc2/drivers/md/dm-table.c =================================================================== --- 2.6.33-rc2.orig/drivers/md/dm-table.c +++ 2.6.33-rc2/drivers/md/dm-table.c @@ -1241,8 +1241,6 @@ void dm_table_unplug_all(struct dm_table struct mapped_device *dm_table_get_md(struct dm_table *t) { - dm_get(t->md); - return t->md; } Index: 2.6.33-rc2/drivers/md/dm-uevent.c =================================================================== --- 2.6.33-rc2.orig/drivers/md/dm-uevent.c +++ 2.6.33-rc2/drivers/md/dm-uevent.c @@ -187,7 +187,7 @@ void dm_path_uevent(enum dm_uevent_type if (event_type >= ARRAY_SIZE(_dm_uevent_type_names)) { DMERR("%s: Invalid event_type %d", __func__, event_type); - goto out; + return; } event = dm_build_path_uevent(md, ti, @@ -195,12 +195,9 @@ void dm_path_uevent(enum dm_uevent_type _dm_uevent_type_names[event_type].name, path, nr_valid_paths); if (IS_ERR(event)) - goto out; + return; dm_uevent_add(md, &event->elist); - -out: - dm_put(md); } EXPORT_SYMBOL_GPL(dm_path_uevent); Index: 2.6.33-rc2/drivers/md/dm.c =================================================================== --- 2.6.33-rc2.orig/drivers/md/dm.c +++ 2.6.33-rc2/drivers/md/dm.c @@ -2686,23 +2686,13 @@ int dm_suspended_md(struct mapped_device 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; + return dm_suspended_md(dm_table_get_md(ti->table)); } EXPORT_SYMBOL_GPL(dm_suspended); int dm_noflush_suspending(struct dm_target *ti) { - struct mapped_device *md = dm_table_get_md(ti->table); - int r = __noflush_suspending(md); - - dm_put(md); - - return r; + return __noflush_suspending(dm_table_get_md(ti->table)); } EXPORT_SYMBOL_GPL(dm_noflush_suspending);