diff --git a/acinclude.m4 b/acinclude.m4 index db381a2854..64f41a7581 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -615,6 +615,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_AOP_WRITEBACK_CONTROL LINUX_FS_STRUCT_FOP_HAS_FLOCK LINUX_FS_STRUCT_FOP_HAS_SENDFILE + LINUX_FS_STRUCT_FOP_HAS_SPLICE LINUX_KERNEL_LINUX_SYSCALL_H LINUX_KERNEL_LINUX_SEQ_FILE_H LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG @@ -866,6 +867,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) if test "x$ac_cv_linux_fs_struct_fop_has_sendfile" = "xyes" ; then AC_DEFINE(STRUCT_FILE_OPERATIONS_HAS_SENDFILE, 1, [define if your struct file_operations has sendfile]) fi + if test "x$ac_cv_linux_fs_struct_fop_has_splice" = "xyes" ; then + AC_DEFINE(STRUCT_FILE_OPERATIONS_HAS_SPLICE, 1, [define if your struct file_operations has splice_write and splice_read]) + fi if test "x$ac_cv_linux_register_sysctl_table_noflag" = "xyes" ; then AC_DEFINE(REGISTER_SYSCTL_TABLE_NOFLAG, 1, [define if register_sysctl_table has no insert_at head flag]) fi diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 93bba1cef1..b5b29d101b 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -660,6 +660,10 @@ struct file_operations afs_file_fops = { .flush = afs_linux_flush, #if defined(AFS_LINUX26_ENV) && defined(STRUCT_FILE_OPERATIONS_HAS_SENDFILE) .sendfile = generic_file_sendfile, +#endif +#if defined(AFS_LINUX26_ENV) && defined(STRUCT_FILE_OPERATIONS_HAS_SPLICE) + .splice_write = generic_file_splice_write, + .splice_read = generic_file_splice_read, #endif .release = afs_linux_release, .fsync = afs_linux_fsync, diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 659edaf0b1..36dce1a2f8 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -913,3 +913,15 @@ AC_DEFUN([LINUX_HAVE_SVC_ADDR_IN], [ ac_cv_linux_have_svc_addr_in=no)]) AC_MSG_RESULT($ac_cv_linux_have_svc_addr_in)]) +AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_SPLICE], [ + AC_MSG_CHECKING([for splice_write and splice_read in struct file_operations]) + AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_splice], [ + AC_TRY_KBUILD( +[#include ], +[struct file_operations _fop; +_fop.splice_write(NULL, NULL, NULL, 0, 0); +_fop.splice_read(NULL, NULL, NULL, 0, 0);], + ac_cv_linux_fs_struct_fop_has_splice=yes, + ac_cv_linux_fs_struct_fop_has_splice=no)]) + AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_splice)]) +