Whamcloud - gitweb
LU-9558 llite: generic_readlink is no longer exported 80/27280/2
authorJames Simmons <uja.ornl@yahoo.com>
Wed, 24 May 2017 23:12:41 +0000 (19:12 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 3 Jun 2017 03:59:03 +0000 (03:59 +0000)
Starting in linux kernel 4.10 if inode_operation's
readlink field is NULL then it is assumed to be using
generic_readlink. Since this is the case the function
generic_readlink is no longer visible to individual
file systems.

Linux-commit: dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5

Change-Id: I847844cc53f7ae80d9d212590f5026a92da0107e
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/27280
Tested-by: Jenkins
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/autoconf/lustre-core.m4
lustre/llite/symlink.c

index 46d2ca8..77d6a98 100644 (file)
@@ -2467,6 +2467,25 @@ struct_posix_acl_xattr, [
 ]) # LC_STRUCT_POSIX_ACL_XATTR
 
 #
 ]) # LC_STRUCT_POSIX_ACL_XATTR
 
 #
+# LC_IOP_GENERIC_READLINK
+#
+# Kernel version 4.10 commit dfeef68862edd7d4bafe68ef7aeb5f658ef24bb5
+# removed generic_readlink from individual file systems
+#
+AC_DEFUN([LC_IOP_GENERIC_READLINK], [
+LB_CHECK_COMPILE([if 'generic_readlink' still exist],
+inode_ops_readlink, [
+       #include <linux/fs.h>
+],[
+       struct inode_operations iop;
+       iop.readlink = generic_readlink;
+],[
+       AC_DEFINE(HAVE_IOP_GENERIC_READLINK, 1,
+               [generic_readlink has been removed])
+])
+]) # LC_IOP_GENERIC_READLINK
+
+#
 # LC_PROG_LINUX
 #
 # Lustre linux kernel checks
 # LC_PROG_LINUX
 #
 # Lustre linux kernel checks
@@ -2670,6 +2689,9 @@ AC_DEFUN([LC_PROG_LINUX], [
        # 4.9
        LC_GROUP_INFO_GID
 
        # 4.9
        LC_GROUP_INFO_GID
 
+       # 4.10
+       LC_IOP_GENERIC_READLINK
+
        #
        AS_IF([test "x$enable_server" != xno], [
                LC_FUNC_DEV_SET_RDONLY
        #
        AS_IF([test "x$enable_server" != xno], [
                LC_FUNC_DEV_SET_RDONLY
index b0993a1..7095955 100644 (file)
@@ -221,7 +221,9 @@ static const char *ll_follow_link(struct dentry *dentry, void **cookie)
 #endif /* HAVE_SYMLINK_OPS_USE_NAMEIDATA */
 
 struct inode_operations ll_fast_symlink_inode_operations = {
 #endif /* HAVE_SYMLINK_OPS_USE_NAMEIDATA */
 
 struct inode_operations ll_fast_symlink_inode_operations = {
+#ifdef HAVE_IOP_GENERIC_READLINK
        .readlink       = generic_readlink,
        .readlink       = generic_readlink,
+#endif
        .setattr        = ll_setattr,
 #ifdef HAVE_IOP_GET_LINK
        .get_link       = ll_get_link,
        .setattr        = ll_setattr,
 #ifdef HAVE_IOP_GET_LINK
        .get_link       = ll_get_link,