summaryrefslogtreecommitdiff
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2021-06-05 23:20:17 -0400
committerMatthew Wilcox (Oracle) <willy@infradead.org>2021-09-27 09:27:29 -0400
commitc25303281d79299e9f35d4b2e496a8bd134d5715 (patch)
treeb71b1e663e9bbc24346993d9b6fcf6574675680a /include/linux/mm.h
parent5816b3e6577eaa676ceb00a848f0fd65fe2adc29 (diff)
mm: Convert get_page_unless_zero() to return bool
atomic_add_unless() returns bool, so remove the widening casts to int in page_ref_add_unless() and get_page_unless_zero(). This causes gcc to produce slightly larger code in isolate_migratepages_block(), but it's not clear that it's worse code. Net +19 bytes of text. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Reviewed-by: David Howells <dhowells@redhat.com> Acked-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 73a52aba448f..1de8864a1e28 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -754,7 +754,7 @@ static inline int put_page_testzero(struct page *page)
* This can be called when MMU is off so it must not access
* any of the virtual mappings.
*/
-static inline int get_page_unless_zero(struct page *page)
+static inline bool get_page_unless_zero(struct page *page)
{
return page_ref_add_unless(page, 1, 0);
}