jbd2: Convert release_buffer_page() to use a folio

Saves a few calls to compound_head().
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: default avatarTheodore Ts'o <tytso@mit.edu>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
parent c56a6eb0
......@@ -62,6 +62,7 @@ static void journal_end_buffer_io_sync(struct buffer_head *bh, int uptodate)
*/
static void release_buffer_page(struct buffer_head *bh)
{
struct folio *folio;
struct page *page;
if (buffer_dirty(bh))
......@@ -71,18 +72,19 @@ static void release_buffer_page(struct buffer_head *bh)
page = bh->b_page;
if (!page)
goto nope;
if (page->mapping)
folio = page_folio(page);
if (folio->mapping)
goto nope;
/* OK, it's a truncated page */
if (!trylock_page(page))
if (!folio_trylock(folio))
goto nope;
get_page(page);
folio_get(folio);
__brelse(bh);
try_to_free_buffers(page);
unlock_page(page);
put_page(page);
try_to_free_buffers(&folio->page);
folio_unlock(folio);
folio_put(folio);
return;
nope:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment