From: Alexey Dobriyan Date: Thu, 11 Apr 2024 17:51:07 +0000 (+0300) Subject: vfs, swap: compile out IS_SWAPFILE() on swapless configs X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e964fc77577a9afe528e54b50527cf49e24aa211;p=linux.git vfs, swap: compile out IS_SWAPFILE() on swapless configs No swap support -- no swapfiles possible. Signed-off-by: Alexey Dobriyan (Yandex) Link: https://lore.kernel.org/r/2391c7f5-0f83-4188-ae56-4ec7ccbf2576@p183 Signed-off-by: Christian Brauner --- diff --git a/include/linux/fs.h b/include/linux/fs.h index b053f98393e66..d376dd7057d53 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2260,7 +2260,13 @@ static inline bool sb_rdonly(const struct super_block *sb) { return sb->s_flags #define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD) #define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME) + +#ifdef CONFIG_SWAP #define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) +#else +#define IS_SWAPFILE(inode) ((void)(inode), 0U) +#endif + #define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) #define IS_IMA(inode) ((inode)->i_flags & S_IMA) #define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT)