From b811df01f6ab94b86a70e687bd431d17c8a20ec2 Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Fri, 21 Feb 2025 17:20:06 +0000 Subject: [PATCH] LU-18687 compat: move generic-radix-tree to lustre_compat Migrate the backported radix tree code to lustre_compat. Eventually, all of the Lustre/LNet compatability code will live in lustre_compat - maintaining a clear separation from the functional code in Lustre and LNet. Test-Parameters: trivial Signed-off-by: Timothy Day Change-Id: Iaf6fed877b23829be948f1347d21e1ff7b9ce5a9 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58148 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Shaun Tancheff Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- libcfs/include/libcfs/linux/Makefile.am | 3 +-- libcfs/libcfs/Makefile.in | 1 - libcfs/libcfs/linux/Makefile.am | 3 +-- lnet/include/lnet/lib-lnet.h | 2 +- lnet/lnet/api-ni.c | 2 +- lnet/selftest/conctl.c | 2 +- lustre/include/lustre_kernelcomm.h | 2 +- lustre/target/tgt_mount.c | 2 +- lustre_compat/include/lustre_compat/linux/Makefile.am | 2 +- .../include/lustre_compat}/linux/generic-radix-tree.h | 8 +++++--- lustre_compat/lib/Makefile.in | 2 +- {libcfs/libcfs/linux => lustre_compat/lib}/generic-radix-tree.c | 2 +- 12 files changed, 15 insertions(+), 16 deletions(-) rename {libcfs/include/libcfs => lustre_compat/include/lustre_compat}/linux/generic-radix-tree.h (97%) rename {libcfs/libcfs/linux => lustre_compat/lib}/generic-radix-tree.c (99%) diff --git a/libcfs/include/libcfs/linux/Makefile.am b/libcfs/include/libcfs/linux/Makefile.am index b68341c..f788f9d 100644 --- a/libcfs/include/libcfs/linux/Makefile.am +++ b/libcfs/include/libcfs/linux/Makefile.am @@ -6,5 +6,4 @@ EXTRA_DIST = linux-misc.h linux-fs.h linux-mem.h linux-time.h linux-cpu.h \ linux-list.h linux-hash.h linux-wait.h linux-net.h \ - generic-radix-tree.h refcount.h processor.h \ - linux-fortify-string.h + refcount.h processor.h linux-fortify-string.h diff --git a/libcfs/libcfs/Makefile.in b/libcfs/libcfs/Makefile.in index c4f9a6a..81c6cc6 100644 --- a/libcfs/libcfs/Makefile.in +++ b/libcfs/libcfs/Makefile.in @@ -14,7 +14,6 @@ libcfs_dir := $(dir $(lastword $(MAKEFILE_LIST))) libcfs-linux-objs := linux-prim.o libcfs-linux-objs += linux-hash.o libcfs-linux-objs += linux-wait.o -libcfs-linux-objs += generic-radix-tree.o libcfs-compat-objs += $(patsubst %,$(COMPAT)%,$(compat_objs)) diff --git a/libcfs/libcfs/linux/Makefile.am b/libcfs/libcfs/linux/Makefile.am index 22bc2eb..52fddc2 100644 --- a/libcfs/libcfs/linux/Makefile.am +++ b/libcfs/libcfs/linux/Makefile.am @@ -6,5 +6,4 @@ EXTRA_DIST = linux-prim.c \ linux-hash.c \ - linux-wait.c \ - generic-radix-tree.c + linux-wait.c diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index 519870f..8881f7a 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -19,7 +19,7 @@ #define CFS_FAIL_MATCH_MD_NID 0xe001 #define CFS_FAIL_DELAY_MSG_FORWARD 0xe002 -#include +#include #include #include diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index 951aa64..43b0af9 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -11,7 +11,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include -#include +#include #include #include #include diff --git a/lnet/selftest/conctl.c b/lnet/selftest/conctl.c index 785e6bb..3ac930d 100644 --- a/lnet/selftest/conctl.c +++ b/lnet/selftest/conctl.c @@ -15,7 +15,7 @@ * Author: Liang Zhen */ -#include +#include #include #include #include diff --git a/lustre/include/lustre_kernelcomm.h b/lustre/include/lustre_kernelcomm.h index cb85267..6cb594c 100644 --- a/lustre/include/lustre_kernelcomm.h +++ b/lustre/include/lustre_kernelcomm.h @@ -19,7 +19,7 @@ #ifndef __LUSTRE_KERNELCOMM_H__ #define __LUSTRE_KERNELCOMM_H__ -#include +#include #include #include /* For declarations shared with userspace */ diff --git a/lustre/target/tgt_mount.c b/lustre/target/tgt_mount.c index 28cbea1..e3f3df1 100644 --- a/lustre/target/tgt_mount.c +++ b/lustre/target/tgt_mount.c @@ -19,7 +19,7 @@ #define D_MOUNT (D_SUPER | D_CONFIG /* | D_WARNING */) #include -#include +#include #ifdef HAVE_LINUX_SELINUX_IS_ENABLED #include #endif diff --git a/lustre_compat/include/lustre_compat/linux/Makefile.am b/lustre_compat/include/lustre_compat/linux/Makefile.am index 6cf90d8..da9f069 100644 --- a/lustre_compat/include/lustre_compat/linux/Makefile.am +++ b/lustre_compat/include/lustre_compat/linux/Makefile.am @@ -4,4 +4,4 @@ # This file is part of Lustre, http://www.lustre.org/ # -EXTRA_DIST = xarray.h glob.h +EXTRA_DIST = xarray.h glob.h generic-radix-tree.h diff --git a/libcfs/include/libcfs/linux/generic-radix-tree.h b/lustre_compat/include/lustre_compat/linux/generic-radix-tree.h similarity index 97% rename from libcfs/include/libcfs/linux/generic-radix-tree.h rename to lustre_compat/include/lustre_compat/linux/generic-radix-tree.h index c61bb59..7ed7cab 100644 --- a/libcfs/include/libcfs/linux/generic-radix-tree.h +++ b/lustre_compat/include/lustre_compat/linux/generic-radix-tree.h @@ -1,5 +1,5 @@ -#ifndef _LINUX_GENERIC_RADIX_TREE_H -#define _LINUX_GENERIC_RADIX_TREE_H +#ifndef _LINUX_GENERIC_RADIX_TREE_LUSTRE_H +#define _LINUX_GENERIC_RADIX_TREE_LUSTRE_H /** * DOC: Generic radix trees/sparse arrays @@ -231,5 +231,7 @@ int __genradix_prealloc(struct __genradix *, size_t, gfp_t); _gfp) -#endif /* _LINUX_GENERIC_RADIX_TREE_H */ +#else +#include #endif /* ! HAVE_GENRADIX_SUPPORT */ +#endif /* _LINUX_GENERIC_RADIX_TREE_LUSTRE_H */ diff --git a/lustre_compat/lib/Makefile.in b/lustre_compat/lib/Makefile.in index cbf777f..baf5240 100644 --- a/lustre_compat/lib/Makefile.in +++ b/lustre_compat/lib/Makefile.in @@ -4,7 +4,7 @@ # This file is part of Lustre, http://www.lustre.org/ # -compat_objs := xarray.o glob.o +compat_objs := xarray.o glob.o generic-radix-tree.o EXTRA_DIST = $(compat_objs:.o=.c) diff --git a/libcfs/libcfs/linux/generic-radix-tree.c b/lustre_compat/lib/generic-radix-tree.c similarity index 99% rename from libcfs/libcfs/linux/generic-radix-tree.c rename to lustre_compat/lib/generic-radix-tree.c index ac96895..e2d3b0f 100644 --- a/libcfs/libcfs/linux/generic-radix-tree.c +++ b/lustre_compat/lib/generic-radix-tree.c @@ -3,7 +3,7 @@ /* Taken from 5.15 kernel */ #include -#include +#include #include #include #include -- 1.8.3.1