Call bdevsw_add_generic() later so that there is no chance of returning

with an inconsistent state.  I think the return actually "can't happen".

Cleaned up style of recent changes.

I only fiddled with this because of bugs in recent changes.
This commit is contained in:
Bruce Evans 1996-08-28 17:45:08 +00:00
parent 62494ee3f3
commit 2df511e27c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=17864

View File

@ -38,7 +38,7 @@
* from: Utah Hdr: vn.c 1.13 94/04/02
*
* from: @(#)vn.c 8.6 (Berkeley) 4/1/94
* $Id: vn.c,v 1.39 1996/08/19 21:06:39 julian Exp $
* $Id: vn.c,v 1.40 1996/08/22 03:50:00 julian Exp $
*/
/*
@ -149,7 +149,7 @@ static u_long vn_options;
static void vniodone (struct buf *bp);
static int vnsetcred (struct vn_softc *vn, struct ucred *cred);
static void vnshutdown (int ,void *);
static void vnshutdown (int, void *);
static void vnclear (struct vn_softc *vn);
static int
@ -620,11 +620,11 @@ vn_drvinit(void *unused)
#endif
if( ! vn_devsw_installed ) {
bdevsw_add_generic(BDEV_MAJOR,CDEV_MAJOR, &vn_bdevsw);
if(at_shutdown(&vnshutdown, NULL, SHUTDOWN_POST_SYNC)) {
if (at_shutdown(&vnshutdown, NULL, SHUTDOWN_POST_SYNC)) {
printf("vn: could not install shutdown hook\n");
return;
}
bdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &vn_bdevsw);
#ifdef DEVFS
for (unit = 0; unit < NVN; unit++) {
vn = vn_softc[unit];