Skip to content

Commit 06d4414

Browse files
author
Matthew Wilcox (Oracle)
committed
mm: Fix READ_ONLY_THP warning
These counters only exist if CONFIG_READ_ONLY_THP_FOR_FS is defined, but we do not need to warn if the filesystem natively supports large folios. Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
1 parent d68ecca commit 06d4414

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/pagemap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ static inline void filemap_nr_thps_inc(struct address_space *mapping)
326326
if (!mapping_large_folio_support(mapping))
327327
atomic_inc(&mapping->nr_thps);
328328
#else
329-
WARN_ON_ONCE(1);
329+
WARN_ON_ONCE(mapping_large_folio_support(mapping) == 0);
330330
#endif
331331
}
332332

@@ -336,7 +336,7 @@ static inline void filemap_nr_thps_dec(struct address_space *mapping)
336336
if (!mapping_large_folio_support(mapping))
337337
atomic_dec(&mapping->nr_thps);
338338
#else
339-
WARN_ON_ONCE(1);
339+
WARN_ON_ONCE(mapping_large_folio_support(mapping) == 0);
340340
#endif
341341
}
342342

0 commit comments

Comments
 (0)