Whamcloud - gitweb
LU-6215 llite: handle new_sync_[read|write] removal 65/15165/5
authorJames Simmons <uja.ornl@yahoo.com>
Thu, 30 Jul 2015 16:04:41 +0000 (12:04 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 9 Aug 2015 23:40:33 +0000 (23:40 +0000)
In newer linux kernel version the file read/write
API have been moving to using struct iov_iter. To
continue supporting the old API new wrapper
functions were created, new_sync_*, which allowed
the use of the new API's to support the old API's.
For the linux 4.1 kernel those new_sync_* are used
internally so they are no longer exposed to any
file systems. If a file system wants to use the
"old" api they need to call vfs_[write|read].
Update lustre to handle this change. The upstream
commit that made new_sync_* internal was:

Linux commit: 5d5d568975307877e9195f5305f4240e506a2807

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

index 2ce6386..0d83e19 100644 (file)
@@ -1823,6 +1823,17 @@ iov_iter_rw, [
 ]) # LC_IOV_ITER_RW
 
 #
 ]) # LC_IOV_ITER_RW
 
 #
+# LC_HAVE_SYNC_READ_WRITE
+#
+# 4.1 new_sync_[read|write] no longer exported
+#
+AC_DEFUN([LC_HAVE_SYNC_READ_WRITE], [
+LB_CHECK_EXPORT([new_sync_read], [fs/read_write.c],
+       [AC_DEFINE(HAVE_SYNC_READ_WRITE, 1,
+                       [new_sync_[read|write] is exported by the kernel])])
+]) # LC_HAVE_SYNC_READ_WRITE
+
+#
 # LC_PROG_LINUX
 #
 # Lustre linux kernel checks
 # LC_PROG_LINUX
 #
 # Lustre linux kernel checks
@@ -1971,6 +1982,7 @@ AC_DEFUN([LC_PROG_LINUX], [
 
        # 4.1.0
        LC_IOV_ITER_RW
 
        # 4.1.0
        LC_IOV_ITER_RW
+       LC_HAVE_SYNC_READ_WRITE
 
        #
        AS_IF([test "x$enable_server" != xno], [
 
        #
        AS_IF([test "x$enable_server" != xno], [
index 92640cc..97ad193 100644 (file)
@@ -3467,9 +3467,11 @@ int ll_inode_permission(struct inode *inode, int mask, struct nameidata *nd)
 /* -o localflock - only provides locally consistent flock locks */
 struct file_operations ll_file_operations = {
 #ifdef HAVE_FILE_OPERATIONS_READ_WRITE_ITER
 /* -o localflock - only provides locally consistent flock locks */
 struct file_operations ll_file_operations = {
 #ifdef HAVE_FILE_OPERATIONS_READ_WRITE_ITER
+# ifdef HAVE_SYNC_READ_WRITE
        .read           = new_sync_read,
        .read           = new_sync_read,
-       .read_iter      = ll_file_read_iter,
        .write          = new_sync_write,
        .write          = new_sync_write,
+# endif
+       .read_iter      = ll_file_read_iter,
        .write_iter     = ll_file_write_iter,
 #else /* !HAVE_FILE_OPERATIONS_READ_WRITE_ITER */
        .read           = ll_file_read,
        .write_iter     = ll_file_write_iter,
 #else /* !HAVE_FILE_OPERATIONS_READ_WRITE_ITER */
        .read           = ll_file_read,
@@ -3489,9 +3491,11 @@ struct file_operations ll_file_operations = {
 
 struct file_operations ll_file_operations_flock = {
 #ifdef HAVE_FILE_OPERATIONS_READ_WRITE_ITER
 
 struct file_operations ll_file_operations_flock = {
 #ifdef HAVE_FILE_OPERATIONS_READ_WRITE_ITER
+# ifdef HAVE_SYNC_READ_WRITE
        .read           = new_sync_read,
        .read           = new_sync_read,
-       .read_iter      = ll_file_read_iter,
        .write          = new_sync_write,
        .write          = new_sync_write,
+# endif /* HAVE_SYNC_READ_WRITE */
+       .read_iter      = ll_file_read_iter,
        .write_iter     = ll_file_write_iter,
 #else /* !HAVE_FILE_OPERATIONS_READ_WRITE_ITER */
        .read           = ll_file_read,
        .write_iter     = ll_file_write_iter,
 #else /* !HAVE_FILE_OPERATIONS_READ_WRITE_ITER */
        .read           = ll_file_read,
@@ -3514,9 +3518,11 @@ struct file_operations ll_file_operations_flock = {
 /* These are for -o noflock - to return ENOSYS on flock calls */
 struct file_operations ll_file_operations_noflock = {
 #ifdef HAVE_FILE_OPERATIONS_READ_WRITE_ITER
 /* These are for -o noflock - to return ENOSYS on flock calls */
 struct file_operations ll_file_operations_noflock = {
 #ifdef HAVE_FILE_OPERATIONS_READ_WRITE_ITER
+# ifdef HAVE_SYNC_READ_WRITE
        .read           = new_sync_read,
        .read           = new_sync_read,
-       .read_iter      = ll_file_read_iter,
        .write          = new_sync_write,
        .write          = new_sync_write,
+# endif /* HAVE_SYNC_READ_WRITE */
+       .read_iter      = ll_file_read_iter,
        .write_iter     = ll_file_write_iter,
 #else /* !HAVE_FILE_OPERATIONS_READ_WRITE_ITER */
        .read           = ll_file_read,
        .write_iter     = ll_file_write_iter,
 #else /* !HAVE_FILE_OPERATIONS_READ_WRITE_ITER */
        .read           = ll_file_read,