From b66594cfa14b099434f73be55d2109cacf202cb0 Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Fri, 21 Feb 2025 15:55:18 +0000 Subject: [PATCH] LU-18687 compat: move glob to lustre_compat Migrate the backported glob 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: I7e57326a0ed10225e2ee866071ea7c3d259d29d4 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58145 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 | 2 +- libcfs/libcfs/Makefile.in | 1 - libcfs/libcfs/linux/Makefile.am | 3 +-- lustre/obdclass/kernelcomm.c | 2 +- lustre/obdclass/lprocfs_status.c | 2 +- lustre_compat/include/lustre_compat/linux/Makefile.am | 2 +- .../libcfs => lustre_compat/include/lustre_compat}/linux/glob.h | 9 ++++++--- lustre_compat/lib/Makefile.in | 2 +- {libcfs/libcfs/linux => lustre_compat/lib}/glob.c | 2 +- 9 files changed, 13 insertions(+), 12 deletions(-) rename {libcfs/include/libcfs => lustre_compat/include/lustre_compat}/linux/glob.h (65%) rename {libcfs/libcfs/linux => lustre_compat/lib}/glob.c (98%) diff --git a/libcfs/include/libcfs/linux/Makefile.am b/libcfs/include/libcfs/linux/Makefile.am index 63043d1..b68341c 100644 --- a/libcfs/include/libcfs/linux/Makefile.am +++ b/libcfs/include/libcfs/linux/Makefile.am @@ -6,5 +6,5 @@ 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 glob.h refcount.h processor.h \ + generic-radix-tree.h refcount.h processor.h \ linux-fortify-string.h diff --git a/libcfs/libcfs/Makefile.in b/libcfs/libcfs/Makefile.in index 112db33..c4f9a6a 100644 --- a/libcfs/libcfs/Makefile.in +++ b/libcfs/libcfs/Makefile.in @@ -15,7 +15,6 @@ 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-linux-objs += glob.o libcfs-compat-objs += $(patsubst %,$(COMPAT)%,$(compat_objs)) diff --git a/libcfs/libcfs/linux/Makefile.am b/libcfs/libcfs/linux/Makefile.am index e4027de..22bc2eb 100644 --- a/libcfs/libcfs/linux/Makefile.am +++ b/libcfs/libcfs/linux/Makefile.am @@ -7,5 +7,4 @@ EXTRA_DIST = linux-prim.c \ linux-hash.c \ linux-wait.c \ - generic-radix-tree.c \ - glob.c + generic-radix-tree.c diff --git a/lustre/obdclass/kernelcomm.c b/lustre/obdclass/kernelcomm.c index 40c0a2da..06f7733 100644 --- a/lustre/obdclass/kernelcomm.c +++ b/lustre/obdclass/kernelcomm.c @@ -19,7 +19,7 @@ #define DEBUG_SUBSYSTEM S_CLASS #include -#include +#include #include #include diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 7973079..68d1f0a 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -15,7 +15,7 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include +#include #include #include #include diff --git a/lustre_compat/include/lustre_compat/linux/Makefile.am b/lustre_compat/include/lustre_compat/linux/Makefile.am index 303749c..6cf90d8 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 +EXTRA_DIST = xarray.h glob.h diff --git a/libcfs/include/libcfs/linux/glob.h b/lustre_compat/include/lustre_compat/linux/glob.h similarity index 65% rename from libcfs/include/libcfs/linux/glob.h rename to lustre_compat/include/lustre_compat/linux/glob.h index 401661a..2345a20 100644 --- a/libcfs/include/libcfs/linux/glob.h +++ b/lustre_compat/include/lustre_compat/linux/glob.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _LINUX_GLOB_H -#define _LINUX_GLOB_H +#ifndef _LINUX_GLOB_LUSTRE_H +#define _LINUX_GLOB_LUSTRE_H #ifndef HAVE_GLOB @@ -9,6 +9,9 @@ #include /* For __pure */ bool __pure glob_match(char const *pat, char const *str); + +#else +#include #endif /* !HAVE_GLOB */ -#endif /* _LINUX_GLOB_H */ +#endif /* _LINUX_GLOB_LUSTRE_H */ diff --git a/lustre_compat/lib/Makefile.in b/lustre_compat/lib/Makefile.in index 944a5f5..cbf777f 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 +compat_objs := xarray.o glob.o EXTRA_DIST = $(compat_objs:.o=.c) diff --git a/libcfs/libcfs/linux/glob.c b/lustre_compat/lib/glob.c similarity index 98% rename from libcfs/libcfs/linux/glob.c rename to lustre_compat/lib/glob.c index 9019246..efbcc1d 100644 --- a/libcfs/libcfs/linux/glob.c +++ b/lustre_compat/lib/glob.c @@ -1,6 +1,6 @@ #ifndef HAVE_GLOB #include -#include "libcfs/linux/glob.h" +#include /** * glob_match - Shell-style pattern matching, like !fnmatch(pat, str, 0) -- 1.8.3.1