Whamcloud - gitweb
LU-13163 mdc: new kernel function xa_is_value() 99/37399/3
authorLai Siyao <lai.siyao@whamcloud.com>
Sat, 25 Jan 2020 00:30:44 +0000 (08:30 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 8 Feb 2020 04:06:56 +0000 (04:06 +0000)
xa_is_value() is added in kernel 4.19-rc6 to replace
radix_tree_entry_exceptional().

Test-Parameters: trivial clientdistro=el8.1 envdefinitions=ONLY=65i testlist=sanity,sanity,sanity,sanity,sanity
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: If89aa19c37af8a67debe782d1c77f4ef4dc6f923
Reviewed-on: https://review.whamcloud.com/37399
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/include/lustre_compat.h
lustre/mdc/mdc_request.c

index c6b5821..a39489a 100644 (file)
@@ -2771,6 +2771,23 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # LC_INODE_TIMESPEC64
 
 #
+# 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 <linux/xarray.h>
+],[
+       xa_is_value(NULL);
+],[
+       AC_DEFINE(HAVE_XA_IS_VALUE, 1, [xa_is_value exist])
+])
+]) # LC_XA_IS_VALUE
+
+#
 # LC___XA_SET_MARK
 #
 # kernel 4.20 commit v4.19-rc5-248-g9b89a0355144
@@ -3142,6 +3159,7 @@ AC_DEFUN([LC_PROG_LINUX], [
 
        # 4.18
        LC_INODE_TIMESPEC64
+       LC_XA_IS_VALUE
 
        # 4.20
        LC___XA_SET_MARK
index 73562da..3ebef7a 100644 (file)
@@ -330,6 +330,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)
 {
index bc96326..b1ccedf 100644 (file)
@@ -1134,7 +1134,7 @@ static struct page *mdc_page_locate(struct address_space *mapping, __u64 *hash,
        xa_lock_irqsave(&mapping->i_pages, flags);
        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);