]>
Commit | Line | Data |
---|---|---|
6b0a4be5 RN |
1 | dnl # |
2 | dnl # EL7 have backported copy_file_range and clone_file_range and | |
3 | dnl # added them to an "extended" file_operations struct. | |
4 | dnl # | |
5 | dnl # We're testing for both functions in one here, because they will only | |
6 | dnl # ever appear together and we don't want to match a similar method in | |
7 | dnl # some future vendor kernel. | |
8 | dnl # | |
9 | AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_FILE_OPERATIONS_EXTEND], [ | |
10 | ZFS_LINUX_TEST_SRC([vfs_file_operations_extend], [ | |
11 | #include <linux/fs.h> | |
12 | ||
13 | static ssize_t test_copy_file_range(struct file *src_file, | |
14 | loff_t src_off, struct file *dst_file, loff_t dst_off, | |
15 | size_t len, unsigned int flags) { | |
16 | (void) src_file; (void) src_off; | |
17 | (void) dst_file; (void) dst_off; | |
18 | (void) len; (void) flags; | |
19 | return (0); | |
20 | } | |
21 | ||
22 | static int test_clone_file_range(struct file *src_file, | |
23 | loff_t src_off, struct file *dst_file, loff_t dst_off, | |
24 | u64 len) { | |
25 | (void) src_file; (void) src_off; | |
26 | (void) dst_file; (void) dst_off; | |
27 | (void) len; | |
28 | return (0); | |
29 | } | |
30 | ||
31 | static const struct file_operations_extend | |
32 | fops __attribute__ ((unused)) = { | |
33 | .kabi_fops = {}, | |
34 | .copy_file_range = test_copy_file_range, | |
35 | .clone_file_range = test_clone_file_range, | |
36 | }; | |
37 | ],[]) | |
38 | ]) | |
39 | AC_DEFUN([ZFS_AC_KERNEL_VFS_FILE_OPERATIONS_EXTEND], [ | |
40 | AC_MSG_CHECKING([whether file_operations_extend takes \ | |
41 | .copy_file_range() and .clone_file_range()]) | |
42 | ZFS_LINUX_TEST_RESULT([vfs_file_operations_extend], [ | |
43 | AC_MSG_RESULT([yes]) | |
44 | AC_DEFINE(HAVE_VFS_FILE_OPERATIONS_EXTEND, 1, | |
45 | [file_operations_extend takes .copy_file_range() | |
46 | and .clone_file_range()]) | |
47 | ],[ | |
48 | AC_MSG_RESULT([no]) | |
49 | ]) | |
50 | ]) |