From a259082d66ba482aa4044abd1b41ac4219585473 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Mon, 29 Aug 2016 19:19:48 -0400 Subject: [PATCH] LU-8560 llite: handle is_compat_task() rename The linux kernel 4.6 renamed is_compat_task() to in_compat_syscall(). Change-Id: I2d3733a1ec03873d000b9f25aa8a98c3b02be410 Signed-off-by: James Simmons Reviewed-on: http://review.whamcloud.com/22208 Reviewed-by: Frank Zago Tested-by: Jenkins Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- lustre/autoconf/lustre-core.m4 | 20 ++++++++++++++++++++ lustre/include/lustre_patchless_compat.h | 4 ++++ lustre/llite/llite_internal.h | 2 +- lustre/osd-ldiskfs/osd_internal.h | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 77e0059..3772621 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -2201,6 +2201,23 @@ inode_ops_get_link, [ ]) # LC_HAVE_IOP_GET_LINK # +# LC_HAVE_IN_COMPAT_SYSCALL +# +# 4.6 renamed is_compat_task to in_compat_syscall +# +AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [ +LB_CHECK_COMPILE([if 'in_compat_syscall' is defined], +in_compat_syscall, [ + #include +],[ + in_compat_syscall(); +],[ + AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1, + [have in_compat_syscall]) +]) +]) # LC_HAVE_IN_COMPAT_SYSCALL + +# # LC_PROG_LINUX # # Lustre linux kernel checks @@ -2383,6 +2400,9 @@ AC_DEFUN([LC_PROG_LINUX], [ LC_HAVE_INODE_LOCK LC_HAVE_IOP_GET_LINK + # 4.6 + LC_HAVE_IN_COMPAT_SYSCALL + # AS_IF([test "x$enable_server" != xno], [ LC_FUNC_DEV_SET_RDONLY diff --git a/lustre/include/lustre_patchless_compat.h b/lustre/include/lustre_patchless_compat.h index 58daecf..644ab78 100644 --- a/lustre/include/lustre_patchless_compat.h +++ b/lustre/include/lustre_patchless_compat.h @@ -135,4 +135,8 @@ truncate_complete_page(struct address_space *mapping, struct page *page) #define ATTR_CTIME_SET (1 << 28) #endif +#ifndef HAVE_IN_COMPAT_SYSCALL +#define in_compat_syscall is_compat_task +#endif + #endif /* LUSTRE_PATCHLESS_COMPAT_H */ diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index a79d49a..96770ad 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -653,7 +653,7 @@ static inline int ll_need_32bit_api(struct ll_sb_info *sbi) #if BITS_PER_LONG == 32 return 1; #elif defined(CONFIG_COMPAT) - return unlikely(is_compat_task() || (sbi->ll_flags & LL_SBI_32BIT_API)); + return unlikely(in_compat_syscall() || (sbi->ll_flags & LL_SBI_32BIT_API)); #else return unlikely(sbi->ll_flags & LL_SBI_32BIT_API); #endif diff --git a/lustre/osd-ldiskfs/osd_internal.h b/lustre/osd-ldiskfs/osd_internal.h index 0c966be..3f685a7 100644 --- a/lustre/osd-ldiskfs/osd_internal.h +++ b/lustre/osd-ldiskfs/osd_internal.h @@ -1185,7 +1185,7 @@ int osd_acct_obj_lookup(struct osd_thread_info *info, struct osd_device *osd, static inline int is_32bit_api(void) { #ifdef CONFIG_COMPAT - return is_compat_task(); + return in_compat_syscall(); #else return (BITS_PER_LONG == 32); #endif -- 1.8.3.1