From owner-svn-src-all@freebsd.org Thu Dec 12 18:45:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FF651D878E; Thu, 12 Dec 2019 18:45:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47YjRJ2Xv3z3yQP; Thu, 12 Dec 2019 18:45:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3393E45; Thu, 12 Dec 2019 18:45:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBCIjWD7075555; Thu, 12 Dec 2019 18:45:32 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBCIjVn0075552; Thu, 12 Dec 2019 18:45:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912121845.xBCIjVn0075552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 12 Dec 2019 18:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355660 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 355660 X-SVN-Commit-Repository: base 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.29 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: Thu, 12 Dec 2019 18:45:32 -0000 Author: trasz Date: Thu Dec 12 18:45:31 2019 New Revision: 355660 URL: https://svnweb.freebsd.org/changeset/base/355660 Log: Add kern_sync(9), and make kernel code call it instead of going via sys_sync(2). Minor cleanup, no functional changes. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19366 Modified: head/sys/kern/vfs_bio.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Dec 12 18:27:54 2019 (r355659) +++ head/sys/kern/vfs_bio.c Thu Dec 12 18:45:31 2019 (r355660) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include @@ -1342,7 +1342,7 @@ bufshutdown(int show_busybufs) * Sync filesystems for shutdown */ wdog_kern_pat(WD_LASTVAL); - sys_sync(curthread, NULL); + kern_sync(curthread); /* * With soft updates, some buffers that are @@ -1369,7 +1369,7 @@ bufshutdown(int show_busybufs) pbusy = nbusy; wdog_kern_pat(WD_LASTVAL); - sys_sync(curthread, NULL); + kern_sync(curthread); #ifdef PREEMPTION /* Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Dec 12 18:27:54 2019 (r355659) +++ head/sys/kern/vfs_syscalls.c Thu Dec 12 18:45:31 2019 (r355660) @@ -114,17 +114,8 @@ static int kern_readlink_vp(struct vnode *vp, char *bu static int kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path, enum uio_seg segflag); -/* - * Sync each mounted filesystem. - */ -#ifndef _SYS_SYSPROTO_H_ -struct sync_args { - int dummy; -}; -#endif -/* ARGSUSED */ int -sys_sync(struct thread *td, struct sync_args *uap) +kern_sync(struct thread *td) { struct mount *mp, *nmp; int save; @@ -149,6 +140,22 @@ sys_sync(struct thread *td, struct sync_args *uap) } mtx_unlock(&mountlist_mtx); return (0); +} + +/* + * Sync each mounted filesystem. + */ +#ifndef _SYS_SYSPROTO_H_ +struct sync_args { + int dummy; +}; +#endif +/* ARGSUSED */ +int +sys_sync(struct thread *td, struct sync_args *uap) +{ + + return (kern_sync(td)); } /* Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Thu Dec 12 18:27:54 2019 (r355659) +++ head/sys/sys/syscallsubr.h Thu Dec 12 18:45:31 2019 (r355660) @@ -276,6 +276,7 @@ int kern_statfs(struct thread *td, const char *path, e struct statfs *buf); int kern_symlinkat(struct thread *td, const char *path1, int fd, const char *path2, enum uio_seg segflg); +int kern_sync(struct thread *td); int kern_ktimer_create(struct thread *td, clockid_t clock_id, struct sigevent *evp, int *timerid, int preset_id); int kern_ktimer_delete(struct thread *, int);