else {
osi_FlushPages(vcp, credp); /* ensure stale pages are gone */
AFS_GUNLOCK();
+#ifdef DO_SYNC_READ
+ code = do_sync_read(fp, buf, count, offp);
+#else
code = generic_file_read(fp, buf, count, offp);
+#endif
AFS_GLOCK();
}
code = -code;
else {
AFS_GUNLOCK();
+#ifdef DO_SYNC_READ
+ code = do_sync_write(fp, buf, count, offp);
+#else
code = generic_file_write(fp, buf, count, offp);
+#endif
AFS_GLOCK();
}
struct file_operations afs_file_fops = {
.read = afs_linux_read,
.write = afs_linux_write,
+#ifdef GENERIC_FILE_AIO_READ
+ .aio_read = generic_file_aio_read,
+ .aio_write = generic_file_aio_write,
+#endif
#ifdef HAVE_UNLOCKED_IOCTL
.unlocked_ioctl = afs_unlocked_xioctl,
#else
if test "x$ac_cv_key_alloc_needs_struct_task" = "xyes"; then
AC_DEFINE([KEY_ALLOC_NEEDS_STRUCT_TASK], 1, [define if key_alloc takes a struct task *])
fi])
+
+AC_DEFUN([LINUX_DO_SYNC_READ], [
+ AC_MSG_CHECKING([for linux do_sync_read()])
+ AC_CACHE_VAL([ac_cv_linux_do_sync_read], [
+ AC_TRY_KBUILD(
+[#include <linux/fs.h>],
+[do_sync_read(NULL, NULL, 0, NULL);],
+ ac_cv_linux_do_sync_read=yes,
+ ac_cv_linux_do_sync_read=no)])
+ AC_MSG_RESULT($ac_cv_linux_do_sync_read)
+ if test "x$ac_cv_linux_do_sync_read" = "xyes"; then
+ AC_DEFINE([DO_SYNC_READ], 1, [define if your kernel has do_sync_read()])
+ fi])
+
+AC_DEFUN([LINUX_GENERIC_FILE_AIO_READ], [
+ AC_MSG_CHECKING([for linux generic_file_aio_read()])
+ AC_CACHE_VAL([ac_cv_linux_generic_file_aio_read], [
+ AC_TRY_KBUILD(
+[#include <linux/fs.h>],
+[generic_file_aio_read(NULL, NULL, 0, 0);],
+ ac_cv_linux_generic_file_aio_read=yes,
+ ac_cv_linux_generic_file_aio_read=no)])
+ AC_MSG_RESULT($ac_cv_linux_generic_file_aio_read)
+ if test "x$ac_cv_linux_generic_file_aio_read" = "xyes"; then
+ AC_DEFINE([GENERIC_FILE_AIO_READ], 1, [define if your kernel has generic_file_aio_read()])
+ fi])