Date: Mon, 29 Aug 2016 06:32:30 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304987 - in stable/11/sys: compat/cloudabi compat/linux kern sys Message-ID: <201608290632.u7T6WUSZ076674@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Aug 29 06:32:30 2016 New Revision: 304987 URL: https://svnweb.freebsd.org/changeset/base/304987 Log: MFC r304182 (by ed): Let CloudABI use fdatasync() as well. MFC r304185 (by ed): Eliminate use of sys_fsync() and sys_fdatasync(). Modified: stable/11/sys/compat/cloudabi/cloudabi_fd.c stable/11/sys/compat/linux/linux_file.c stable/11/sys/kern/vfs_syscalls.c stable/11/sys/sys/syscallsubr.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- stable/11/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 29 06:07:43 2016 (r304986) +++ stable/11/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 29 06:32:30 2016 (r304987) @@ -172,12 +172,8 @@ int cloudabi_sys_fd_datasync(struct thread *td, struct cloudabi_sys_fd_datasync_args *uap) { - struct fsync_args fsync_args = { - .fd = uap->fd - }; - /* Call into fsync(), as FreeBSD lacks fdatasync(). */ - return (sys_fsync(td, &fsync_args)); + return (kern_fsync(td, uap->fd, false)); } int @@ -557,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: stable/11/sys/compat/linux/linux_file.c ============================================================================== --- stable/11/sys/compat/linux/linux_file.c Mon Aug 29 06:07:43 2016 (r304986) +++ stable/11/sys/compat/linux/linux_file.c Mon Aug 29 06:32:30 2016 (r304987) @@ -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: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Mon Aug 29 06:07:43 2016 (r304986) +++ stable/11/sys/kern/vfs_syscalls.c Mon Aug 29 06:32:30 2016 (r304987) @@ -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: stable/11/sys/sys/syscallsubr.h ============================================================================== --- stable/11/sys/sys/syscallsubr.h Mon Aug 29 06:07:43 2016 (r304986) +++ stable/11/sys/sys/syscallsubr.h Mon Aug 29 06:32:30 2016 (r304987) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608290632.u7T6WUSZ076674>