Skip to content

Commit e964fc7

Browse files
Alexey Dobriyanbrauner
authored andcommitted
vfs, swap: compile out IS_SWAPFILE() on swapless configs
No swap support -- no swapfiles possible. Signed-off-by: Alexey Dobriyan (Yandex) <[email protected]> Link: https://lore.kernel.org/r/2391c7f5-0f83-4188-ae56-4ec7ccbf2576@p183 Signed-off-by: Christian Brauner <[email protected]>
1 parent 42bd2af commit e964fc7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

include/linux/fs.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2260,7 +2260,13 @@ static inline bool sb_rdonly(const struct super_block *sb) { return sb->s_flags
22602260

22612261
#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD)
22622262
#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME)
2263+
2264+
#ifdef CONFIG_SWAP
22632265
#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE)
2266+
#else
2267+
#define IS_SWAPFILE(inode) ((void)(inode), 0U)
2268+
#endif
2269+
22642270
#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE)
22652271
#define IS_IMA(inode) ((inode)->i_flags & S_IMA)
22662272
#define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT)

0 commit comments

Comments
 (0)