From c94ad52faa1fd2ad2caa81d129d4b218d591d844 Mon Sep 17 00:00:00 2001 From: Lai Siyao Date: Fri, 7 Feb 2020 22:30:29 -0800 Subject: [PATCH] LU-13163 mdc: new kernel function xa_is_value() xa_is_value() is added in kernel 4.19-rc6 to replace radix_tree_entry_exceptional(). This patch is back-ported from the following one: Lustre-commit: a0a3a29deb82656f9639f46847deac2689973893 Lustre-change: https://review.whamcloud.com/37399 Test-Parameters: trivial clientdistro=el8.1 \ envdefinitions=ONLY=65i mdscount=2 mdtcount=4 \ testlist=sanity,sanity,sanity,sanity,sanity Signed-off-by: Lai Siyao Change-Id: If89aa19c37af8a67debe782d1c77f4ef4dc6f923 Reviewed-on: https://review.whamcloud.com/37481 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- lustre/autoconf/lustre-core.m4 | 18 ++++++++++++++++++ lustre/include/lustre_compat.h | 7 +++++++ lustre/mdc/mdc_request.c | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index af6a65b..09823b0 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -2774,6 +2774,23 @@ group_info_gid, [ ]) # LC_GROUP_INFO_GID # +# LC_XA_IS_VALUE +# kernel 4.19-rc6 commit 3159f943aafdbacb2f94c38fdaadabf2bbde2a14 +# xarray: Replace exceptional entries +# adds xa_is_value +# +AC_DEFUN([LC_XA_IS_VALUE], [ +LB_CHECK_COMPILE([xa_is_value exist], +xa_is_value, [ + #include +],[ + xa_is_value(NULL); +],[ + AC_DEFINE(HAVE_XA_IS_VALUE, 1, [xa_is_value exist]) +]) +]) # LC_XA_IS_VALUE + +# # LC_VFS_SETXATTR # # Kernel version 4.9 commit 5d6c31910bc0713e37628dc0ce677dcb13c8ccf4 @@ -3325,6 +3342,7 @@ AC_DEFUN([LC_PROG_LINUX], [ # 4.18 LC_INODE_TIMESPEC64 + LC_XA_IS_VALUE # kernel patch to extend integrity interface LC_BIO_INTEGRITY_PREP_FN diff --git a/lustre/include/lustre_compat.h b/lustre/include/lustre_compat.h index 534df7c..516cad4 100644 --- a/lustre/include/lustre_compat.h +++ b/lustre/include/lustre_compat.h @@ -385,6 +385,13 @@ static inline int radix_tree_exceptional_entry(void *arg) } #endif +#ifndef HAVE_XA_IS_VALUE +static inline bool xa_is_value(void *entry) +{ + return radix_tree_exceptional_entry(entry); +} +#endif + #ifndef HAVE_TRUNCATE_INODE_PAGES_FINAL static inline void truncate_inode_pages_final(struct address_space *map) { diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 892860e..1806fd0 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1107,7 +1107,7 @@ static struct page *mdc_page_locate(struct address_space *mapping, __u64 *hash, xa_lock_irq(&mapping->i_pages); found = radix_tree_gang_lookup(&mapping->page_tree, (void **)&page, offset, 1); - if (found > 0 && !radix_tree_exceptional_entry(page)) { + if (found > 0 && !xa_is_value(page)) { struct lu_dirpage *dp; get_page(page); -- 1.8.3.1