Page MenuHomeFreeBSD

D22959.id66118.diff
No OneTemporary

D22959.id66118.diff

Index: amd64/linux/linux_dummy.c
===================================================================
--- amd64/linux/linux_dummy.c
+++ amd64/linux/linux_dummy.c
@@ -144,8 +144,6 @@
DUMMY(membarrier);
/* Linux 4.4: */
DUMMY(mlock2);
-/* Linux 4.5: */
-DUMMY(copy_file_range);
/* Linux 4.6: */
DUMMY(preadv2);
DUMMY(pwritev2);
Index: amd64/linux32/linux32_dummy.c
===================================================================
--- amd64/linux32/linux32_dummy.c
+++ amd64/linux32/linux32_dummy.c
@@ -148,8 +148,6 @@
DUMMY(membarrier);
/* Linux 4.4: */
DUMMY(mlock2);
-/* Linux 4.5: */
-DUMMY(copy_file_range);
/* Linux 4.6: */
DUMMY(preadv2);
DUMMY(pwritev2);
Index: arm64/linux/linux_dummy.c
===================================================================
--- arm64/linux/linux_dummy.c
+++ arm64/linux/linux_dummy.c
@@ -142,8 +142,6 @@
DUMMY(membarrier);
/* Linux 4.4: */
DUMMY(mlock2);
-/* Linux 4.5: */
-DUMMY(copy_file_range);
/* Linux 4.6: */
DUMMY(preadv2);
DUMMY(pwritev2);
Index: compat/linux/linux_file.c
===================================================================
--- compat/linux/linux_file.c
+++ compat/linux/linux_file.c
@@ -1565,3 +1565,33 @@
return (kern_posix_fallocate(td, args->fd, args->offset,
args->len));
}
+
+int
+linux_copy_file_range(struct thread *td, struct linux_copy_file_range_args
+ *args)
+{
+ l_loff_t inoff, outoff, *inoffp, *outoffp;
+ int error;
+
+ inoffp = outoffp = NULL;
+ if (args->off_in != NULL) {
+ error = copyin(args->off_in, &inoff, sizeof(l_loff_t));
+ if (error != 0)
+ return (error);
+ inoffp = &inoff;
+ }
+ if (args->off_out != NULL) {
+ error = copyin(args->off_out, &outoff, sizeof(l_loff_t));
+ if (error != 0)
+ return (error);
+ outoffp = &outoff;
+ }
+ error = kern_copy_file_range(td, args->fd_in, inoffp, args->fd_out,
+ outoffp, args->len, args->flags);
+ if (error == 0 && args->off_in != NULL)
+ error = copyout(inoffp, args->off_in, sizeof(l_loff_t));
+ if (error == 0 && args->off_out != NULL)
+ error = copyout(outoffp, args->off_out, sizeof(l_loff_t));
+ return (error);
+}
+
Index: i386/linux/linux_dummy.c
===================================================================
--- i386/linux/linux_dummy.c
+++ i386/linux/linux_dummy.c
@@ -144,8 +144,6 @@
DUMMY(membarrier);
/* Linux 4.4: */
DUMMY(mlock2);
-/* Linux 4.5: */
-DUMMY(copy_file_range);
/* Linux 4.6: */
DUMMY(preadv2);
DUMMY(pwritev2);

File Metadata

Mime Type
text/plain
Expires
Fri, Oct 24, 11:39 AM (13 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24130552
Default Alt Text
D22959.id66118.diff (2 KB)

Event Timeline