From: Derrick Brashear Date: Thu, 12 Sep 2013 12:09:34 +0000 (-0400) Subject: linux: provide read and write ops even when we have aio X-Git-Tag: upstream/1.8.0_pre1^2~1014 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e6af2ffc86af17c4be427384467c4122fc5301b3;p=packages%2Fo%2Fopenafs.git linux: provide read and write ops even when we have aio read/write will fall back to aio ops but e.g. writev will fail if there is not either a write or writev op explicitly. force the fallback via do_sync_read/do_sync_write required with 2.6.18-348.x rhel kernels but probably not newer ones Change-Id: I773a8e38df435015e4bc9fc353d930d14b3e6791 Reviewed-on: http://gerrit.openafs.org/10246 Reviewed-by: Marc Dionne Tested-by: BuildBot Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/acinclude.m4 b/acinclude.m4 index 800333bea..ddda7f874 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -836,6 +836,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) AC_CHECK_LINUX_STRUCT([cred], [session_keyring], [cred.h]) AC_CHECK_LINUX_STRUCT([ctl_table], [ctl_name], [sysctl.h]) AC_CHECK_LINUX_STRUCT([dentry_operations], [d_automount], [dcache.h]) + AC_CHECK_LINUX_STRUCT([file_operations], [writev], [fs.h]) AC_CHECK_LINUX_STRUCT([inode], [i_alloc_sem], [fs.h]) AC_CHECK_LINUX_STRUCT([inode], [i_blkbits], [fs.h]) AC_CHECK_LINUX_STRUCT([inode], [i_blksize], [fs.h]) diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index a60027eca..88d24304c 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -802,6 +802,10 @@ struct file_operations afs_file_fops = { #ifdef HAVE_LINUX_GENERIC_FILE_AIO_READ .aio_read = afs_linux_aio_read, .aio_write = afs_linux_aio_write, +#ifdef STRUCT_FILE_OPERATIONS_HAS_WRITEV + .read = do_sync_read, + .write = do_sync_write, +#endif #else .read = afs_linux_read, .write = afs_linux_write,