summaryrefslogtreecommitdiff
path: root/sys/dev/dm/dm_target_snapshot.c
diff options
context:
space:
mode:
authorhaad <haad@NetBSD.org>2008-12-19 16:30:41 +0000
committerhaad <haad@NetBSD.org>2008-12-19 16:30:41 +0000
commit78284dcaf12637bfbb20587a1462594b9f2b730a (patch)
tree2100fb14f4ebfd8ed671b082aa5a7ef354ba6957 /sys/dev/dm/dm_target_snapshot.c
parent210ce8a4644c8bbb37146181ab162e59738a52ec (diff)
Add infrastructure needed to load device-mapper targets as modules.
Targets wasn't converted yet and at least snapshot target will be converted in a near future.
Diffstat (limited to 'sys/dev/dm/dm_target_snapshot.c')
-rw-r--r--sys/dev/dm/dm_target_snapshot.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/dm/dm_target_snapshot.c b/sys/dev/dm/dm_target_snapshot.c
index 3482fa04491..725d525ca63 100644
--- a/sys/dev/dm/dm_target_snapshot.c
+++ b/sys/dev/dm/dm_target_snapshot.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_target_snapshot.c,v 1.2 2008/12/19 15:24:03 haad Exp $ */
+/* $NetBSD: dm_target_snapshot.c,v 1.3 2008/12/19 16:30:41 haad Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -220,6 +220,9 @@ dm_target_snapshot_destroy(dm_table_entry_t *table_en)
if (tsc->tsc_persistent_dev)
dm_pdev_decr(tsc->tsc_cow_dev);
+
+ /* Unbusy target so we can unload it */
+ dm_target_unbusy(table_en->target);
kmem_free(table_en->target_config, sizeof(dm_target_snapshot_config_t));
@@ -385,6 +388,9 @@ dm_target_snapshot_orig_destroy(dm_table_entry_t *table_en)
/* Decrement pdev ref counter if 0 remove it */
dm_pdev_decr(tsoc->tsoc_real_dev);
+
+ /* Unbusy target so we can unload it */
+ dm_target_unbusy(table_en->target);
kmem_free(table_en->target_config, sizeof(dm_target_snapshot_origin_config_t));