Commit 1252ad13 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Dave Kleikamp

jfs: Convert force_metapage to use a folio

Convert the mp->page to a folio and operate on it.  That lets us
convert metapage_write_one() to take a folio.  Replaces five calls to
compound_head() with one.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarDave Kleikamp <dave.kleikamp@oracle.com>
parent d9c36002
......@@ -689,9 +689,8 @@ void grab_metapage(struct metapage * mp)
unlock_page(mp->page);
}
static int metapage_write_one(struct page *page)
static int metapage_write_one(struct folio *folio)
{
struct folio *folio = page_folio(page);
struct address_space *mapping = folio->mapping;
struct writeback_control wbc = {
.sync_mode = WB_SYNC_ALL,
......@@ -720,17 +719,17 @@ static int metapage_write_one(struct page *page)
void force_metapage(struct metapage *mp)
{
struct page *page = mp->page;
struct folio *folio = page_folio(mp->page);
jfs_info("force_metapage: mp = 0x%p", mp);
set_bit(META_forcewrite, &mp->flag);
clear_bit(META_sync, &mp->flag);
get_page(page);
lock_page(page);
set_page_dirty(page);
if (metapage_write_one(page))
folio_get(folio);
folio_lock(folio);
folio_mark_dirty(folio);
if (metapage_write_one(folio))
jfs_error(mp->sb, "metapage_write_one() failed\n");
clear_bit(META_forcewrite, &mp->flag);
put_page(page);
folio_put(folio);
}
void hold_metapage(struct metapage *mp)
......@@ -771,7 +770,7 @@ void release_metapage(struct metapage * mp)
folio_mark_dirty(folio);
if (test_bit(META_sync, &mp->flag)) {
clear_bit(META_sync, &mp->flag);
if (metapage_write_one(&folio->page))
if (metapage_write_one(folio))
jfs_error(mp->sb, "metapage_write_one() failed\n");
folio_lock(folio);
}
......
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