summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2014-12-15 11:05:53 +0000
committerkib <kib@FreeBSD.org>2014-12-15 11:05:53 +0000
commitd05fefb955b5c3aa7d8ec136a9170d6f25d8ac1f (patch)
tree4fa6eafcb1b521c724246679a3896e2a2dca2bcc /sys/kern/vfs_subr.c
parent679b472095e0522991b6b16d01ec57aec95f9f55 (diff)
downloadFreeBSD-src-d05fefb955b5c3aa7d8ec136a9170d6f25d8ac1f.zip
FreeBSD-src-d05fefb955b5c3aa7d8ec136a9170d6f25d8ac1f.tar.gz
MFC r275620:
Add functions syncer_suspend() and syncer_resume(). MFC r275637: Remove local variable for real.
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 9c90fe5..56e73c2 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1773,6 +1773,8 @@ sync_vnode(struct synclist *slp, struct bufobj **bo, struct thread *td)
return (0);
}
+static int first_printf = 1;
+
/*
* System filesystem synchronizer daemon.
*/
@@ -1786,12 +1788,10 @@ sched_sync(void)
int last_work_seen;
int net_worklist_len;
int syncer_final_iter;
- int first_printf;
int error;
last_work_seen = 0;
syncer_final_iter = 0;
- first_printf = 1;
syncer_state = SYNCER_RUNNING;
starttime = time_uptime;
td->td_pflags |= TDP_NORUNNINGBUF;
@@ -1948,6 +1948,25 @@ syncer_shutdown(void *arg, int howto)
kproc_shutdown(arg, howto);
}
+void
+syncer_suspend(void)
+{
+
+ syncer_shutdown(updateproc, 0);
+}
+
+void
+syncer_resume(void)
+{
+
+ mtx_lock(&sync_mtx);
+ first_printf = 1;
+ syncer_state = SYNCER_RUNNING;
+ mtx_unlock(&sync_mtx);
+ cv_broadcast(&sync_wakeup);
+ kproc_resume(updateproc);
+}
+
/*
* Reassign a buffer from one vnode to another.
* Used to assign file specific control information
OpenPOWER on IntegriCloud