diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-03-11 19:47:26 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-03-11 19:47:26 +0000 |
commit | e3ec8702bcfcc0aef0b3e110cf1bb5a22d8eab36 (patch) | |
tree | ea01128c4f5b73129000f8281c7239b54ed7b474 /sys/kern | |
parent | 0f19f5dba157291a0ce304b76c3c2f8253705cfb (diff) |
backout
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_subr.c | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 59fd706af2a..dbb9721598a 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.35 1999/03/11 18:55:24 deraadt Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.36 1999/03/11 19:47:25 deraadt Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -1727,6 +1727,9 @@ vfs_unmountall() void vfs_shutdown() { + register struct buf *bp; + int iter, nbusy; + /* XXX Should suspend scheduling. */ (void) spl0(); @@ -1748,40 +1751,24 @@ vfs_shutdown() vfs_unmountall(); } - if (vfs_syncwait(1)) - printf("giving up\n"); - else - printf("done\n"); -} - -/* - * perform sync() operation and wait for buffers to flush. - * assumtions: called w/ scheduler disabled and physical io enabled - * for now called at spl0() XXX - */ -int -vfs_syncwait(verbose) - int verbose; -{ - register struct buf *bp; - int iter, nbusy; - + /* Sync again after unmount, just in case. */ sys_sync(&proc0, (void *)0, (register_t *)0); - + /* Wait for sync to finish. */ for (iter = 0; iter < 20; iter++) { nbusy = 0; for (bp = &buf[nbuf]; --bp >= buf; ) if ((bp->b_flags & (B_BUSY|B_INVAL)) == B_BUSY) nbusy++; - if (nbusy == 0) - break; - if (verbose) - printf("%d ", nbusy); - DELAY(40000 * iter); - } - - return nbusy; + if (nbusy == 0) + break; + printf("%d ", nbusy); + DELAY(40000 * iter); + } + if (nbusy) + printf("giving up\n"); + else + printf("done\n"); } /* |