vfs_subr.c (132023) | vfs_subr.c (132177) |
---|---|
1/* 2 * Copyright (c) 1989, 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. --- 25 unchanged lines hidden (view full) --- 34 * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 35 */ 36 37/* 38 * External virtual filesystem routines 39 */ 40 41#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1989, 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. --- 25 unchanged lines hidden (view full) --- 34 * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 35 */ 36 37/* 38 * External virtual filesystem routines 39 */ 40 41#include <sys/cdefs.h> |
42__FBSDID("$FreeBSD: head/sys/kern/vfs_subr.c 132023 2004-07-12 08:14:09Z alfred $"); | 42__FBSDID("$FreeBSD: head/sys/kern/vfs_subr.c 132177 2004-07-15 04:29:48Z alfred $"); |
43 44#include "opt_ddb.h" 45#include "opt_mac.h" 46 47#include <sys/param.h> 48#include <sys/systm.h> 49#include <sys/bio.h> 50#include <sys/buf.h> --- 1490 unchanged lines hidden (view full) --- 1541 struct vnode *vp; 1542 struct mount *mp; 1543 long starttime; 1544 struct thread *td = FIRST_THREAD_IN_PROC(updateproc); 1545 static int dummychan; 1546 int last_work_seen; 1547 int net_worklist_len; 1548 int syncer_final_iter; | 43 44#include "opt_ddb.h" 45#include "opt_mac.h" 46 47#include <sys/param.h> 48#include <sys/systm.h> 49#include <sys/bio.h> 50#include <sys/buf.h> --- 1490 unchanged lines hidden (view full) --- 1541 struct vnode *vp; 1542 struct mount *mp; 1543 long starttime; 1544 struct thread *td = FIRST_THREAD_IN_PROC(updateproc); 1545 static int dummychan; 1546 int last_work_seen; 1547 int net_worklist_len; 1548 int syncer_final_iter; |
1549 int first_printf; |
|
1549 1550 mtx_lock(&Giant); 1551 last_work_seen = 0; 1552 syncer_final_iter = 0; | 1550 1551 mtx_lock(&Giant); 1552 last_work_seen = 0; 1553 syncer_final_iter = 0; |
1554 first_printf = 1; |
|
1553 syncer_state = SYNCER_RUNNING; 1554 starttime = time_second; 1555 1556 EVENTHANDLER_REGISTER(shutdown_pre_sync, syncer_shutdown, td->td_proc, 1557 SHUTDOWN_PRI_LAST); 1558 1559 for (;;) { 1560 mtx_lock(&sync_mtx); 1561 if (syncer_state == SYNCER_FINAL_DELAY && 1562 syncer_final_iter == 0) { 1563 mtx_unlock(&sync_mtx); | 1555 syncer_state = SYNCER_RUNNING; 1556 starttime = time_second; 1557 1558 EVENTHANDLER_REGISTER(shutdown_pre_sync, syncer_shutdown, td->td_proc, 1559 SHUTDOWN_PRI_LAST); 1560 1561 for (;;) { 1562 mtx_lock(&sync_mtx); 1563 if (syncer_state == SYNCER_FINAL_DELAY && 1564 syncer_final_iter == 0) { 1565 mtx_unlock(&sync_mtx); |
1566 printf("done.\n"); |
|
1564 kthread_suspend_check(td->td_proc); 1565 mtx_lock(&sync_mtx); 1566 } 1567 net_worklist_len = syncer_worklist_len - sync_vnode_count; | 1567 kthread_suspend_check(td->td_proc); 1568 mtx_lock(&sync_mtx); 1569 } 1570 net_worklist_len = syncer_worklist_len - sync_vnode_count; |
1568 if (syncer_state != SYNCER_RUNNING && starttime != time_second) | 1571 if (syncer_state != SYNCER_RUNNING && 1572 starttime != time_second) { 1573 if (first_printf) { 1574 printf("Syncer syncing disks, " 1575 "buffers remaining... "); 1576 first_printf = 0; 1577 } |
1569 printf("%d ", net_worklist_len); | 1578 printf("%d ", net_worklist_len); |
1579 } |
|
1570 starttime = time_second; 1571 1572 /* 1573 * Push files whose dirty time has expired. Be careful 1574 * of interrupt race on slp queue. 1575 * 1576 * Skip over empty worklist slots when shutting down. 1577 */ --- 2466 unchanged lines hidden --- | 1580 starttime = time_second; 1581 1582 /* 1583 * Push files whose dirty time has expired. Be careful 1584 * of interrupt race on slp queue. 1585 * 1586 * Skip over empty worklist slots when shutting down. 1587 */ --- 2466 unchanged lines hidden --- |