mm/pagemap: make trylock_page return bool
authorHao Ge <gehao@kylinos.cn>
Sun, 28 Apr 2024 01:47:11 +0000 (09:47 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 6 May 2024 00:53:56 +0000 (17:53 -0700)
Make trylock_page return bool to align the return values of folio_trylock
function and it also corresponds to its comment.

Link: https://lkml.kernel.org/r/20240428014711.11169-1-gehao@kylinos.cn
Signed-off-by: Hao Ge <gehao@kylinos.cn>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/pagemap.h

index 2a0bc2ff5258373ba1b72e15b78cb79bf858bf2a..850d32057939d21da177ae6bc7da39bab9bcad6f 100644 (file)
@@ -1012,7 +1012,7 @@ static inline bool folio_trylock(struct folio *folio)
 /*
  * Return true if the page was successfully locked
  */
-static inline int trylock_page(struct page *page)
+static inline bool trylock_page(struct page *page)
 {
        return folio_trylock(page_folio(page));
 }