From owner-svn-src-all@freebsd.org Mon Aug 15 20:11:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E068EBBBBFC; Mon, 15 Aug 2016 20:11:53 +0000 (UTC) (envelope-from ed@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 mx1.freebsd.org (Postfix) with ESMTPS id A368C1A08; Mon, 15 Aug 2016 20:11:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FKBqH9017724; Mon, 15 Aug 2016 20:11:52 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FKBq8h017720; Mon, 15 Aug 2016 20:11:52 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608152011.u7FKBq8h017720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 15 Aug 2016 20:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304185 - in head/sys: compat/cloudabi compat/linux kern sys X-SVN-Group: head 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.22 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 Aug 2016 20:11:54 -0000 Author: ed Date: Mon Aug 15 20:11:52 2016 New Revision: 304185 URL: https://svnweb.freebsd.org/changeset/base/304185 Log: Eliminate use of sys_fsync() and sys_fdatasync(). Make the kern_fsync() function public, so that it can be used by other parts of the kernel. Fix up existing consumers to make use of it. Requested by: kib Modified: head/sys/compat/cloudabi/cloudabi_fd.c head/sys/compat/linux/linux_file.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 15 20:09:09 2016 (r304184) +++ head/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 15 20:11:52 2016 (r304185) @@ -172,11 +172,8 @@ int cloudabi_sys_fd_datasync(struct thread *td, struct cloudabi_sys_fd_datasync_args *uap) { - struct fdatasync_args fdatasync_args = { - .fd = uap->fd - }; - return (sys_fdatasync(td, &fdatasync_args)); + return (kern_fsync(td, uap->fd, false)); } int @@ -556,9 +553,6 @@ cloudabi_sys_fd_stat_put(struct thread * int cloudabi_sys_fd_sync(struct thread *td, struct cloudabi_sys_fd_sync_args *uap) { - struct fsync_args fsync_args = { - .fd = uap->fd - }; - return (sys_fsync(td, &fsync_args)); + return (kern_fsync(td, uap->fd, true)); } Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon Aug 15 20:09:09 2016 (r304184) +++ head/sys/compat/linux/linux_file.c Mon Aug 15 20:11:52 2016 (r304185) @@ -1013,10 +1013,8 @@ linux_fdatasync(td, uap) struct thread *td; struct linux_fdatasync_args *uap; { - struct fsync_args bsd; - bsd.fd = uap->fd; - return (sys_fsync(td, &bsd)); + return (kern_fsync(td, uap->fd, false)); } int Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Aug 15 20:09:09 2016 (r304184) +++ head/sys/kern/vfs_syscalls.c Mon Aug 15 20:11:52 2016 (r304185) @@ -3354,7 +3354,7 @@ freebsd6_ftruncate(struct thread *td, st } #endif -static int +int kern_fsync(struct thread *td, int fd, bool fullsync) { struct vnode *vp; Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Mon Aug 15 20:09:09 2016 (r304184) +++ head/sys/sys/syscallsubr.h Mon Aug 15 20:11:52 2016 (r304185) @@ -100,6 +100,7 @@ int kern_fhstat(struct thread *td, fhand int kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf); int kern_fstat(struct thread *td, int fd, struct stat *sbp); int kern_fstatfs(struct thread *td, int fd, struct statfs *buf); +int kern_fsync(struct thread *td, int fd, bool fullsync); int kern_ftruncate(struct thread *td, int fd, off_t length); int kern_futimes(struct thread *td, int fd, struct timeval *tptr, enum uio_seg tptrseg);