]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-linux-splice-support-20071106
authorAnders Kaseorg <andersk@mit.edu>
Tue, 6 Nov 2007 18:32:37 +0000 (18:32 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 6 Nov 2007 18:32:37 +0000 (18:32 +0000)
support splice in kernels new enough to support it (sendfile is deprecated)

(cherry picked from commit 1951d7d6c773aead0ea6e9d120e23d15fee4a29f)

acinclude.m4
src/afs/LINUX/osi_vnodeops.c
src/cf/linux-test4.m4

index 5f7b9ad219c99512c5117d5767797c1fe6293736..b7408f3106c2e9b0d65c63da71e03beb75913725 100644 (file)
@@ -630,6 +630,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
@@ -881,6 +882,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
index 209737648caeb3d7078b4b5d63a06d8f8121c2c9..a14f58374094d9ab460bf46c10f492a90f8af576 100644 (file)
@@ -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,
index 0d9af92d1a9b1deb582b47d1907f943e5c2046da..afddc82ec764fa3086542fd29b745998d097b8e2 100644 (file)
@@ -921,3 +921,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 <linux/fs.h>],
+[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)])
+