kern_shutdown.c (40751) | kern_shutdown.c (41137) |
---|---|
1/*- 2 * Copyright (c) 1986, 1988, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94 | 1/*- 2 * Copyright (c) 1986, 1988, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94 |
39 * $Id: kern_shutdown.c,v 1.40 1998/09/20 16:50:31 dt Exp $ | 39 * $Id: kern_shutdown.c,v 1.41 1998/10/30 05:41:15 msmith Exp $ |
40 */ 41 42#include "opt_ddb.h" 43#include "opt_hw_wdog.h" 44#include "opt_panic.h" 45#include "opt_show_busybufs.h" 46 47#include <sys/param.h> 48#include <sys/systm.h> 49#include <sys/buf.h> 50#include <sys/reboot.h> 51#include <sys/proc.h> | 40 */ 41 42#include "opt_ddb.h" 43#include "opt_hw_wdog.h" 44#include "opt_panic.h" 45#include "opt_show_busybufs.h" 46 47#include <sys/param.h> 48#include <sys/systm.h> 49#include <sys/buf.h> 50#include <sys/reboot.h> 51#include <sys/proc.h> |
52#include <sys/vnode.h> |
|
52#include <sys/malloc.h> 53#include <sys/kernel.h> 54#include <sys/mount.h> 55#include <sys/queue.h> 56#include <sys/sysctl.h> 57#include <sys/conf.h> 58#include <sys/sysproto.h> 59 --- 159 unchanged lines hidden (view full) --- 219 } 220 } 221 if (nbusy == 0) 222 break; 223 printf("%d ", nbusy); 224 sync(&proc0, NULL); 225 DELAY(50000 * iter); 226 } | 53#include <sys/malloc.h> 54#include <sys/kernel.h> 55#include <sys/mount.h> 56#include <sys/queue.h> 57#include <sys/sysctl.h> 58#include <sys/conf.h> 59#include <sys/sysproto.h> 60 --- 159 unchanged lines hidden (view full) --- 220 } 221 } 222 if (nbusy == 0) 223 break; 224 printf("%d ", nbusy); 225 sync(&proc0, NULL); 226 DELAY(50000 * iter); 227 } |
228 /* 229 * Count only busy local buffers to prevent forcing 230 * a fsck if we're just a client of a wedged NFS server 231 */ 232 nbusy = 0; 233 for (bp = &buf[nbuf]; --bp >= buf; ) { 234 if (((bp->b_flags & (B_BUSY | B_INVAL)) == B_BUSY) 235 ||((bp->b_flags & (B_DELWRI | B_INVAL))== B_DELWRI)) 236 if(bp->b_dev == NODEV) 237 CIRCLEQ_REMOVE(&mountlist, bp->b_vp->v_mount, mnt_list); 238 else 239 nbusy++; 240 241 242 } |
|
227 if (nbusy) { 228 /* 229 * Failed to sync all blocks. Indicate this and don't 230 * unmount filesystems (thus forcing an fsck on reboot). 231 */ 232 printf("giving up\n"); 233#ifdef SHOW_BUSYBUFS 234 nbusy = 0; --- 280 unchanged lines hidden --- | 243 if (nbusy) { 244 /* 245 * Failed to sync all blocks. Indicate this and don't 246 * unmount filesystems (thus forcing an fsck on reboot). 247 */ 248 printf("giving up\n"); 249#ifdef SHOW_BUSYBUFS 250 nbusy = 0; --- 280 unchanged lines hidden --- |