2 dnl # EL7 have backported copy_file_range and clone_file_range and
3 dnl # added them to an "extended" file_operations struct.
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.
9 AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_FILE_OPERATIONS_EXTEND], [
10 ZFS_LINUX_TEST_SRC([vfs_file_operations_extend], [
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;
22 static int test_clone_file_range(struct file *src_file,
23 loff_t src_off, struct file *dst_file, loff_t dst_off,
25 (void) src_file; (void) src_off;
26 (void) dst_file; (void) dst_off;
31 static const struct file_operations_extend
32 fops __attribute__ ((unused)) = {
34 .copy_file_range = test_copy_file_range,
35 .clone_file_range = test_clone_file_range,
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], [
44 AC_DEFINE(HAVE_VFS_FILE_OPERATIONS_EXTEND, 1,
45 [file_operations_extend takes .copy_file_range()
46 and .clone_file_range()])