Skip to contentSkip to conversation

vfs: compile out IS_SWAPFILE() on swapless configs

PATCH Superseded Alexey Dobriyan 2 participants 3 messages Apr 10, 2024 – Apr 11, 2024 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfs: compile out IS_SWAPFILE() on swapless configs

#1 lore raw

On Wed, Apr 10, 2024 at 09:08:01PM +0300, Alexey Dobriyan wrote:

Fyi, this mail is empty for me. Not sure if this was an accident on your end or something else.

#2 lore raw

PATCH RESEND 1/1 vfs, swap: compile out IS_SWAPFILE() on swapless configs

No swap support -- no swapfiles possible.

---

 include/linux/fs.h |    6 ++++++
 1 file changed, 6 insertions(+)
include/linux/fs.h +6 -0
@@ -2253,7 +2253,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)