]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-linux-splice-support-20071106
authorAnders Kaseorg <andersk@mit.edu>
Tue, 6 Nov 2007 18:35:30 +0000 (18:35 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 6 Nov 2007 18:35:30 +0000 (18:35 +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 c4d07d7c50a3c3918d7ef7ef4a8e9609eed7ace1..7789cbc1ac4bdb1af8a69c5609a4715ff0aad711 100644 (file)
@@ -614,6 +614,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
@@ -861,6 +862,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 8b315558ee7827ff368563eb65161f0f3f49936a..16dd4b15e8c10fbceddc982ce8fa5802e4edca58 100644 (file)
@@ -642,6 +642,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 3cb0ee0d9e935737b0aaff0fef71c1b0410c7300..c4e3c4d41d29a1a0d7f39c55bd0967bfa24fa69a 100644 (file)
@@ -894,3 +894,15 @@ _fop.sendfile(NULL, NULL, 0, 0, NULL);],
       ac_cv_linux_fs_struct_fop_has_sendfile=no)])
   AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_sendfile)])
 
+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)])
+