summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorhaad <haad@NetBSD.org>2009-03-06 16:17:29 +0000
committerhaad <haad@NetBSD.org>2009-03-06 16:17:29 +0000
commit50b5b59cc7513bf7728b7c0d297904cda8909e58 (patch)
tree9f9570b819baccc3200d9cb6d28f3264c34a3c63 /sys/dev
parent08d9a1067c80186864feebda4f314ffb07a54849 (diff)
Fix lvm lvrename command. There was bug in dm_dev_lookup where
dm_dev_lookup_name was called with device uuid. Remove dm_dev_t:dk_label is it not used anymore.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/dm/dm.h5
-rw-r--r--sys/dev/dm/dm_dev.c17
2 files changed, 13 insertions, 9 deletions
diff --git a/sys/dev/dm/dm.h b/sys/dev/dm/dm.h
index ed177d8941a..1dc5d7c5d59 100644
--- a/sys/dev/dm/dm.h
+++ b/sys/dev/dm/dm.h
@@ -1,4 +1,4 @@
-/* $NetBSD: dm.h,v 1.10 2009/03/01 23:15:56 haad Exp $ */
+/* $NetBSD: dm.h,v 1.11 2009/03/06 16:17:29 haad Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -43,6 +43,8 @@
#include <sys/rwlock.h>
#include <sys/queue.h>
+#include <sys/disklabel.h>
+
#define DM_MAX_TYPE_NAME 16
#define DM_NAME_LEN 128
#define DM_UUID_LEN 129
@@ -130,7 +132,6 @@ typedef struct dm_dev {
struct dm_dev_head upcalls;
- struct disklabel *dk_label; /* Disklabel for this table. */
struct disk *diskp;
TAILQ_ENTRY(dm_dev) next_upcall; /* LIST of mirrored, snapshoted devices. */
diff --git a/sys/dev/dm/dm_dev.c b/sys/dev/dm/dm_dev.c
index fa5ce67636b..899b4975bad 100644
--- a/sys/dev/dm/dm_dev.c
+++ b/sys/dev/dm/dm_dev.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_dev.c,v 1.2 2008/12/19 15:24:03 haad Exp $ */
+/* $NetBSD: dm_dev.c,v 1.3 2009/03/06 16:17:29 haad Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
#include <sys/types.h>
#include <sys/param.h>
+#include <sys/disk.h>
#include <sys/disklabel.h>
#include <sys/ioctl.h>
#include <sys/ioccom.h>
@@ -89,7 +90,7 @@ dm_dev_lookup(const char *dm_dev_name, const char *dm_dev_uuid,
}
if (dm_dev_uuid != NULL)
- if ((dmv = dm_dev_lookup_name(dm_dev_uuid)) != NULL){
+ if ((dmv = dm_dev_lookup_uuid(dm_dev_uuid)) != NULL){
dm_dev_busy(dmv);
mutex_exit(&dm_dev_mutex);
return dmv;
@@ -304,8 +305,10 @@ dm_dev_alloc()
dm_dev_t *dmv;
dmv = kmem_zalloc(sizeof(dm_dev_t), KM_NOSLEEP);
- dmv->dk_label = kmem_zalloc(sizeof(struct disklabel), KM_NOSLEEP);
-
+
+ if(dmv != NULL)
+ dmv->diskp = kmem_zalloc(sizeof(struct disk), KM_NOSLEEP);
+
return dmv;
}
@@ -316,9 +319,9 @@ int
dm_dev_free(dm_dev_t *dmv)
{
KASSERT(dmv != NULL);
-
- if (dmv->dk_label != NULL)
- (void)kmem_free(dmv->dk_label, sizeof(struct disklabel));
+
+ if(dmv->diskp != NULL)
+ (void)kmem_free(dmv->diskp, sizeof(struct disk));
(void)kmem_free(dmv, sizeof(dm_dev_t));