diff mbox

[RFC] dm: Remove dm_get() from dm_table_get_md()

Message ID 4B41A699.5080802@ct.jp.nec.com (mailing list archive)
State Accepted, archived
Delegated to: Alasdair Kergon
Headers show

Commit Message

Kiyoshi Ueda Jan. 4, 2010, 8:28 a.m. UTC
None
diff mbox

Patch

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);