svn commit: r304987 - in stable/11/sys: compat/cloudabi compat/linux kern sys
Konstantin Belousov
kib at FreeBSD.org
Mon Aug 29 06:32:32 UTC 2016
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);
More information about the svn-src-stable
mailing list