From 75dd69dd6ecac38267a8fbf475945b2a2f293ba9 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Fri, 25 Aug 2023 03:24:12 +0000 Subject: [PATCH] LU-17052 libcfs: fix build for old kernel MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix build for kernel v4.17 to v4.19. These old kernels already have xarray.h and #include by fs.h but don't have full xarray support. It is needed to #include libcfs's xarray.h also to contain xarray support. Rename the header define macro to ensure libcfs's xarray.h will be included。 Test-Parameters: trivial Test-Parameters: testlist=sanityn envdefinitions=ONLY=77,ONLY_REPEAT=20 Fixes: 778791dd7da1 ("LU-8130 libcfs: don't use radix tree for xarray") Change-Id: I760c394cc1d885c2de79d1770243ab7f292b9b3a Signed-off-by: Xinliang Liu Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52090 Tested-by: Maloo Tested-by: jenkins Reviewed-by: Oleg Drokin Reviewed-by: Timothy Day Reviewed-by: James Simmons Reviewed-by: Andreas Dilger --- libcfs/include/libcfs/linux/xarray.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libcfs/include/libcfs/linux/xarray.h b/libcfs/include/libcfs/linux/xarray.h index 74397ab..b252aaf 100644 --- a/libcfs/include/libcfs/linux/xarray.h +++ b/libcfs/include/libcfs/linux/xarray.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ -#ifndef _LINUX_XARRAY_H -#define _LINUX_XARRAY_H +#ifndef _LINUX_XARRAY_LUSTRE_H +#define _LINUX_XARRAY_LUSTRE_H /* * eXtensible Arrays * Copyright (c) 2017 Microsoft Corporation @@ -1763,4 +1763,4 @@ static inline void *xas_next(struct xa_state *xas) } #endif /* !HAVE_XARRAY_SUPPORT */ -#endif /* _LINUX_XARRAY_H */ +#endif /* _LINUX_XARRAY_LUSTRE_H */ -- 1.8.3.1