aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorLukas Ertl <le@FreeBSD.org>2004-03-11 14:11:08 +0000
committerLukas Ertl <le@FreeBSD.org>2004-03-11 14:11:08 +0000
commit5faeb9c6825a94d80c42546ec4332629ccbf4077 (patch)
treeb920656e7953ccc2eb1688a8f901cc3c3d23fd62 /sys
parent8666b655b50b427cf726e873c909dca58c41f862 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/vinum/vinumconfig.c3
-rw-r--r--sys/dev/vinum/vinumio.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/vinum/vinumconfig.c b/sys/dev/vinum/vinumconfig.c
index e622eb1105e3..8c7e0386ce97 100644
--- a/sys/dev/vinum/vinumconfig.c
+++ b/sys/dev/vinum/vinumconfig.c
@@ -476,6 +476,7 @@ get_empty_drive(void)
bzero(drive, sizeof(struct drive));
drive->driveno = driveno; /* put number in structure */
drive->flags |= VF_NEWBORN; /* newly born drive */
+ drive->dev = NODEV;
strcpy(drive->devicename, "unknown"); /* and make the name ``unknown'' */
return driveno; /* return the index */
}
@@ -594,6 +595,8 @@ free_drive(struct drive *drive)
close_locked_drive(drive); /* close it */
if (drive->freelist)
Free(drive->freelist);
+ if (drive->dev != NODEV)
+ dev_rel(drive->dev);
bzero(drive, sizeof(struct drive)); /* this also sets drive_unallocated */
unlockdrive(drive);
}
diff --git a/sys/dev/vinum/vinumio.c b/sys/dev/vinum/vinumio.c
index c458fa305f7f..71a46f59352f 100644
--- a/sys/dev/vinum/vinumio.c
+++ b/sys/dev/vinum/vinumio.c
@@ -58,6 +58,7 @@ open_drive(struct drive *drive, struct thread *td, int verbose)
drive->dev = getdiskbyname(drive->devicename);
if (drive->dev == NODEV) /* didn't find anything */
return ENOENT;
+ dev_ref(drive->dev);
drive->dev->si_iosize_max = DFLTPHYS;
dsw = devsw(drive->dev);