Rearrange disk_detach() slightly, and make a small run-time cosmetic

change in disk_unbusy().
This commit is contained in:
thorpej 1997-12-30 09:51:24 +00:00
parent 2165959350
commit d3eaf8a978
1 changed files with 12 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_disk.c,v 1.22 1997/10/05 18:39:51 thorpej Exp $ */
/* $NetBSD: subr_disk.c,v 1.23 1997/12/30 09:51:24 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -341,18 +341,18 @@ disk_detach(diskp)
struct disk *diskp;
{
/*
* Remove from the disklist.
*/
if (--disk_count < 0)
panic("disk_detach: disk_count < 0");
TAILQ_REMOVE(&disklist, diskp, dk_link);
/*
* Free the space used by the disklabel structures.
*/
free(diskp->dk_label, M_DEVBUF);
free(diskp->dk_cpulabel, M_DEVBUF);
/*
* Remove from the disklist.
*/
TAILQ_REMOVE(&disklist, diskp, dk_link);
if (--disk_count < 0)
panic("disk_detach: disk_count < 0");
}
/*
@ -388,8 +388,10 @@ disk_unbusy(diskp, bcount)
int s;
struct timeval dv_time, diff_time;
if (diskp->dk_busy-- == 0)
panic("disk_unbusy: %s: dk_busy < 0", diskp->dk_name);
if (diskp->dk_busy-- == 0) {
printf("%s: dk_busy < 0\n", diskp->dk_name);
panic("disk_unbusy");
}
s = splclock();
dv_time = mono_time;