diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2024-04-17 18:56:55 +0100 |
---|---|---|
committer | Dave Kleikamp <dave.kleikamp@oracle.com> | 2024-05-27 20:37:06 -0500 |
commit | 1252ad136e1680284c6313156d81d39bc38354c6 (patch) | |
tree | c9dcce0fe7e52f0006e0dfa5a3b21668c82dd5c9 | |
parent | d9c36002d015e49df77cc5dc733f09beaa32765e (diff) |
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: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
-rw-r--r-- | fs/jfs/jfs_metapage.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c index f03e217ec1cb..c88a7bc3f736 100644 --- a/fs/jfs/jfs_metapage.c +++ b/fs/jfs/jfs_metapage.c @@ -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); } |