From ada1f65aa9e088b0f3589da990b2b1e42531a880 Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Mon, 19 Oct 2020 13:11:36 +1100 Subject: [PATCH] LU-13783 libcfs: don't lookup symbol when not needed Linux 5.8 and later do not export kallsyms_lookup_name() so we need to remove dependence on it. Looking up radix_tree_node_cachep is not needed in these kernels, or any kernel were HAVE_XARRAY_SUPPORT is defined. So avoid the lookup in those cases. Signed-off-by: Mr NeilBrown Change-Id: Ia61fe9a025653985b7dcf67b1234d32667719956 Reviewed-on: https://review.whamcloud.com/40825 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Aurelien Degremont --- libcfs/libcfs/linux/linux-prim.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libcfs/libcfs/linux/linux-prim.c b/libcfs/libcfs/linux/linux-prim.c index 5609c52..7fe3df3 100644 --- a/libcfs/libcfs/linux/linux-prim.c +++ b/libcfs/libcfs/linux/linux-prim.c @@ -113,7 +113,9 @@ int cfs_apply_workqueue_attrs(struct workqueue_struct *wq, } EXPORT_SYMBOL_GPL(cfs_apply_workqueue_attrs); +#ifndef HAVE_XARRAY_SUPPORT struct kmem_cache (*radix_tree_node_cachep); +#endif void __init cfs_arch_init(void) { @@ -122,8 +124,10 @@ void __init cfs_arch_init(void) #endif cfs_apply_workqueue_attrs_t = (void *)kallsyms_lookup_name("apply_workqueue_attrs"); +#ifndef HAVE_XARRAY_SUPPORT radix_tree_node_cachep = (void *)kallsyms_lookup_name("radix_tree_node_cachep"); +#endif } int cfs_kernel_write(struct file *filp, const void *buf, size_t count, -- 1.8.3.1