linux-splice-support-20071106

support splice in kernels new enough to support it (sendfile is deprecated)
This commit is contained in:
Anders Kaseorg 2007-11-06 18:30:19 +00:00 committed by Derrick Brashear
parent e06a144f33
commit 1951d7d6c7
3 changed files with 20 additions and 0 deletions

View File

@ -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

View 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,

View File

@ -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 <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)])