svn commit: r275798 - in stable/10/sys: kern sys
Konstantin Belousov
kib at FreeBSD.org
Mon Dec 15 11:05:55 UTC 2014
Author: kib
Date: Mon Dec 15 11:05:53 2014
New Revision: 275798
URL: https://svnweb.freebsd.org/changeset/base/275798
Log:
MFC r275620:
Add functions syncer_suspend() and syncer_resume().
MFC r275637:
Remove local variable for real.
Modified:
stable/10/sys/kern/vfs_subr.c
stable/10/sys/sys/mount.h
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/kern/vfs_subr.c
==============================================================================
--- stable/10/sys/kern/vfs_subr.c Mon Dec 15 11:00:56 2014 (r275797)
+++ stable/10/sys/kern/vfs_subr.c Mon Dec 15 11:05:53 2014 (r275798)
@@ -1773,6 +1773,8 @@ sync_vnode(struct synclist *slp, struct
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
Modified: stable/10/sys/sys/mount.h
==============================================================================
--- stable/10/sys/sys/mount.h Mon Dec 15 11:00:56 2014 (r275797)
+++ stable/10/sys/sys/mount.h Mon Dec 15 11:05:53 2014 (r275798)
@@ -919,6 +919,9 @@ vfs_uninit_t vfs_stduninit;
vfs_extattrctl_t vfs_stdextattrctl;
vfs_sysctl_t vfs_stdsysctl;
+void syncer_suspend(void);
+void syncer_resume(void);
+
#else /* !_KERNEL */
#include <sys/cdefs.h>
More information about the svn-src-stable-10
mailing list