Make vfs_shutdown() look a little nicer.

This commit is contained in:
thorpej 1998-04-26 18:58:54 +00:00
parent 268cc1fea2
commit cbc64bb02d
1 changed files with 15 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_subr.c,v 1.83 1998/03/04 09:13:48 fvdl Exp $ */ /* $NetBSD: vfs_subr.c,v 1.84 1998/04/26 18:58:54 thorpej Exp $ */
/*- /*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -1984,17 +1984,7 @@ void
vfs_shutdown() vfs_shutdown()
{ {
register struct buf *bp; register struct buf *bp;
int iter, nbusy, unmountem; int iter, nbusy;
/*
* If we've panic'd, don't make the situation potentially
* worse by unmounting the file systems; just attempt to
* sync.
*/
if (panicstr != NULL)
unmountem = 0;
else
unmountem = 1;
printf("syncing disks... "); printf("syncing disks... ");
@ -2016,11 +2006,17 @@ vfs_shutdown()
} }
if (nbusy) { if (nbusy) {
printf("giving up\n"); printf("giving up\n");
unmountem = 0; return;
} else } else
printf("done\n"); printf("done\n");
if (unmountem) { /*
* If we've panic'd, don't make the situation potentially
* worse by unmounting the file systems.
*/
if (panicstr != NULL)
return;
/* Release inodes held by texts before update. */ /* Release inodes held by texts before update. */
#if !defined(UVM) #if !defined(UVM)
vnode_pager_umount(NULL); vnode_pager_umount(NULL);
@ -2030,7 +2026,6 @@ vfs_shutdown()
#endif #endif
/* Unmount file systems. */ /* Unmount file systems. */
vfs_unmountall(); vfs_unmountall();
}
} }
/* /*