aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_file.c
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2019-12-14 13:37:17 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2019-12-14 13:37:17 +0000
commitcf69fe66d43c6e91d6a91b1567ff445bb1c0f095 (patch)
tree639b86ddd6195671fd10b10ab90e14e16cd46e87 /sys/compat/linux/linux_file.c
parent0cde2b32394f9dce535431d6ee4736c852622a8d (diff)
downloadsrc-cf69fe66d43c6e91d6a91b1567ff445bb1c0f095.tar.gz
src-cf69fe66d43c6e91d6a91b1567ff445bb1c0f095.zip
Add sync_file_range(2) implementation to linux(4); it's a thin wrapper
over the usual fsync(2). This silences some warnings when running "apt-get upgrade". Reviewed by: brooks, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22371
Notes
Notes: svn path=/head/; revision=355754
Diffstat (limited to 'sys/compat/linux/linux_file.c')
-rw-r--r--sys/compat/linux/linux_file.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index 57723e1aafd7..20d58ea58346 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -908,6 +908,22 @@ linux_fdatasync(td, uap)
}
int
+linux_sync_file_range(td, uap)
+ struct thread *td;
+ struct linux_sync_file_range_args *uap;
+{
+
+ if (uap->offset < 0 || uap->nbytes < 0 ||
+ (uap->flags & ~(LINUX_SYNC_FILE_RANGE_WAIT_BEFORE |
+ LINUX_SYNC_FILE_RANGE_WRITE |
+ LINUX_SYNC_FILE_RANGE_WAIT_AFTER)) != 0) {
+ return (EINVAL);
+ }
+
+ return (kern_fsync(td, uap->fd, false));
+}
+
+int
linux_pread(struct thread *td, struct linux_pread_args *uap)
{
struct vnode *vp;