Whamcloud - gitweb
LU-9183 llite: handle removal the offset argument of direct_IO 22/25822/10
authorDmitry Eremin <dmitry.eremin@intel.com>
Fri, 3 Mar 2017 17:11:40 +0000 (20:11 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 1 May 2017 17:49:07 +0000 (17:49 +0000)
In commit c8b8e32d700fe943a935e435ae251364d016c497 the offset
argument for ->direct_IO() was removed.

Change-Id: I9f1cd5862dfcb40ad6b43b9da3072a852c550c49
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-on: https://review.whamcloud.com/25822
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/autoconf/lustre-core.m4
lustre/llite/rw26.c

index 8ee15f1..a4b33f2 100644 (file)
@@ -2309,6 +2309,28 @@ in_compat_syscall, [
 ]) # LC_HAVE_IN_COMPAT_SYSCALL
 
 #
+# LC_DIRECTIO_2ARGS
+#
+# Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
+# direct-io: eliminate the offset argument to ->direct_IO
+#
+AC_DEFUN([LC_DIRECTIO_2ARGS], [
+LB_CHECK_COMPILE([if '->direct_IO()' taken 2 arguments],
+direct_io_2args, [
+       #include <linux/fs.h>
+],[
+       struct address_space_operations ops;
+       struct iov_iter *iter = NULL;
+       struct kiocb *iocb = NULL;
+       int rc;
+       rc = ops.direct_IO(iocb, iter);
+],[
+       AC_DEFINE(HAVE_DIRECTIO_2ARGS, 1,
+               [direct_IO need 2 arguments])
+])
+]) # LC_DIRECTIO_2ARGS
+
+#
 # LC_HAVE_POSIX_ACL_VALID_USER_NS
 #
 # 4.8 posix_acl_valid takes struct user_namespace
@@ -2534,6 +2556,9 @@ AC_DEFUN([LC_PROG_LINUX], [
        # 4.6
        LC_HAVE_IN_COMPAT_SYSCALL
 
+       # 4.7
+       LC_DIRECTIO_2ARGS
+
        # 4.8
        LC_HAVE_POSIX_ACL_VALID_USER_NS
        LC_D_COMPARE_4ARGS
index 80eb9fc..7dd9510 100644 (file)
@@ -345,9 +345,15 @@ ll_direct_IO(
 # ifndef HAVE_IOV_ITER_RW
             int rw,
 # endif
-            struct kiocb *iocb, struct iov_iter *iter,
-            loff_t file_offset)
+            struct kiocb *iocb, struct iov_iter *iter
+# ifndef HAVE_DIRECTIO_2ARGS
+            , loff_t file_offset
+# endif
+            )
 {
+#ifdef HAVE_DIRECTIO_2ARGS
+       loff_t file_offset = iocb->ki_pos;
+#endif
        struct ll_cl_context *lcc;
        const struct lu_env *env;
        struct cl_io *io;