Whamcloud - gitweb
LU-13783 libcfs: don't lookup symbol when not needed 25/40825/2
authorMr NeilBrown <neilb@suse.de>
Mon, 19 Oct 2020 02:11:36 +0000 (13:11 +1100)
committerOleg Drokin <green@whamcloud.com>
Sun, 13 Dec 2020 08:23:51 +0000 (08:23 +0000)
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 <neilb@suse.de>
Change-Id: Ia61fe9a025653985b7dcf67b1234d32667719956
Reviewed-on: https://review.whamcloud.com/40825
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>

index 5609c52..7fe3df3 100644 (file)
@@ -113,7 +113,9 @@ int cfs_apply_workqueue_attrs(struct workqueue_struct *wq,
 struct kmem_cache (*radix_tree_node_cachep);
 void __init cfs_arch_init(void)
@@ -122,8 +124,10 @@ void __init cfs_arch_init(void)
        cfs_apply_workqueue_attrs_t =
                (void *)kallsyms_lookup_name("apply_workqueue_attrs");
        radix_tree_node_cachep =
                (void *)kallsyms_lookup_name("radix_tree_node_cachep");
 int cfs_kernel_write(struct file *filp, const void *buf, size_t count,