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
This commit is contained in:
Ed Schouten 2016-08-15 20:11:52 +00:00
parent b0f2185bbe
commit 93d9ebd82e
4 changed files with 5 additions and 12 deletions

View File

@ -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 *td,
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));
}

View File

@ -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

View File

@ -3354,7 +3354,7 @@ freebsd6_ftruncate(struct thread *td, struct freebsd6_ftruncate_args *uap)
}
#endif
static int
int
kern_fsync(struct thread *td, int fd, bool fullsync)
{
struct vnode *vp;

View File

@ -100,6 +100,7 @@ int kern_fhstat(struct thread *td, fhandle_t fh, struct stat *buf);
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);