From 73efc566d5a4f3db77f4f000e4b6406fce483b03 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 3 Jan 2023 17:11:30 +0100 Subject: [PATCH] btrfs-progs: kerncompat: hide definition of __init As kerncompat.h is included from all libbtrfs headers we must be careful about generic names like __init, in this case it breaks build of snapper. Signed-off-by: David Sterba --- kerncompat.h | 4 ++++ kernel-shared/compression.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/kerncompat.h b/kerncompat.h index 81ad3d44..6fb79ac8 100644 --- a/kerncompat.h +++ b/kerncompat.h @@ -568,7 +568,11 @@ struct work_struct { typedef struct wait_queue_head_s { } wait_queue_head_t; +/* + * __init cannot be defined in kerncompat.h as it's still part of libbtrfs and + * the macro name is too generic and can break build. #define __init +*/ #define __cold #endif diff --git a/kernel-shared/compression.h b/kernel-shared/compression.h index 285f1a9d..1842da54 100644 --- a/kernel-shared/compression.h +++ b/kernel-shared/compression.h @@ -78,7 +78,7 @@ static inline unsigned int btrfs_compress_level(unsigned int type_level) return ((type_level & 0xF0) >> 4); } -int __init btrfs_init_compress(void); +int btrfs_init_compress(void); void __cold btrfs_exit_compress(void); int btrfs_compress_pages(unsigned int type_level, struct address_space *mapping,