From owner-svn-src-all@FreeBSD.ORG Mon Dec 15 11:05:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E15CB6D2; Mon, 15 Dec 2014 11:05:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3916BB7; Mon, 15 Dec 2014 11:05:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBFB5sHi010960; Mon, 15 Dec 2014 11:05:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBFB5sXX010958; Mon, 15 Dec 2014 11:05:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412151105.sBFB5sXX010958@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Dec 2014 11:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275798 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 11:05:55 -0000 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