]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
mm: Fix READ_ONLY_THP warning
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sat, 10 Oct 2020 15:47:55 +0000 (11:47 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 25 Nov 2020 02:02:12 +0000 (21:02 -0500)
These counters only exist if CONFIG_READ_ONLY_THP_FOR_FS is defined,
but we should not warn if the filesystem natively supports THPs.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
include/linux/pagemap.h

index 0576eb3a4ce9ce146bc0c4f2bfe3b81e13a6e48e..1b418c9b4f34acc923479551470a1e5a203717ee 100644 (file)
@@ -146,7 +146,7 @@ static inline void filemap_nr_thps_inc(struct address_space *mapping)
        if (!mapping_thp_support(mapping))
                atomic_inc(&mapping->nr_thps);
 #else
-       WARN_ON_ONCE(1);
+       WARN_ON_ONCE(!mapping_thp_support(mapping));
 #endif
 }
 
@@ -156,7 +156,7 @@ static inline void filemap_nr_thps_dec(struct address_space *mapping)
        if (!mapping_thp_support(mapping))
                atomic_dec(&mapping->nr_thps);
 #else
-       WARN_ON_ONCE(1);
+       WARN_ON_ONCE(!mapping_thp_support(mapping));
 #endif
 }