diff mbox series

[RESEND] vfs, swap: compile out IS_SWAPFILE() on swapless configs

Message ID 2391c7f5-0f83-4188-ae56-4ec7ccbf2576@p183 (mailing list archive)
State New, archived
Headers show
Series [RESEND] vfs, swap: compile out IS_SWAPFILE() on swapless configs | expand

Commit Message

Alexey Dobriyan April 11, 2024, 5:51 p.m. UTC
No swap support -- no swapfiles possible.

Signed-off-by: Alexey Dobriyan (Yandex) <adobriyan@gmail.com>
---

 include/linux/fs.h |    6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -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)