untested

---
 drivers/md/dm-log.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

Index: linux-2.6.28-rc9/drivers/md/dm-log.c
===================================================================
--- linux-2.6.28-rc9.orig/drivers/md/dm-log.c	2008-12-22 18:28:06.000000000 +0000
+++ linux-2.6.28-rc9/drivers/md/dm-log.c	2008-12-22 20:18:20.000000000 +0000
@@ -20,7 +20,6 @@ struct dm_dirty_log_internal {
 	struct dm_dirty_log_type *type;
 
 	struct list_head list;
-	long use;
 };
 
 static LIST_HEAD(_log_types);
@@ -44,12 +43,8 @@ static struct dm_dirty_log_internal *_ge
 	spin_lock(&_lock);
 
 	log_type = __find_dirty_log_type(name);
-	if (log_type) {
-		if (!log_type->use && !try_module_get(log_type->type->module))
-			log_type = NULL;
-		else
-			log_type->use++;
-	}
+	if (log_type && !try_module_get(log_type->type->module))
+		log_type = NULL;
 
 	spin_unlock(&_lock);
 
@@ -120,10 +115,7 @@ static void put_type(struct dm_dirty_log
 	if (!log_type)
 		goto out;
 
-	if (!--log_type->use)
-		module_put(type->module);
-
-	BUG_ON(log_type->use < 0);
+	module_put(type->module);
 
 out:
 	spin_unlock(&_lock);
@@ -173,7 +165,7 @@ int dm_dirty_log_type_unregister(struct 
 		return -EINVAL;
 	}
 
-	if (log_type->use) {
+	if (type->module && module_refcount(type->module)) {
 		spin_unlock(&_lock);
 		return -ETXTBSY;
 	}