diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2024-04-17 20:56:52 +0300 |
---|---|---|
committer | Dave Kleikamp <dave.kleikamp@oracle.com> | 2024-05-28 04:37:05 +0300 |
commit | f86a3a182483f2c3ec4d83b8d972da8f74882a42 (patch) | |
tree | 7326142bc29592944f6219bb3a85229f6e7bc003 | |
parent | 1f0dc610da985673dd5fc4243f20751eb2df66a7 (diff) | |
download | linux-f86a3a182483f2c3ec4d83b8d972da8f74882a42.tar.xz |
jfs; Convert __invalidate_metapages to use a folio
Retrieve a folio from the page cache instead of a page. Saves a
couple of calls to compound_head().
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 | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c index dd540df0a617..90a284d3bef7 100644 --- a/fs/jfs/jfs_metapage.c +++ b/fs/jfs/jfs_metapage.c @@ -791,7 +791,6 @@ void __invalidate_metapages(struct inode *ip, s64 addr, int len) struct address_space *mapping = JFS_SBI(ip->i_sb)->direct_inode->i_mapping; struct metapage *mp; - struct page *page; unsigned int offset; /* @@ -800,11 +799,12 @@ void __invalidate_metapages(struct inode *ip, s64 addr, int len) */ for (lblock = addr & ~(BlocksPerPage - 1); lblock < addr + len; lblock += BlocksPerPage) { - page = find_lock_page(mapping, lblock >> l2BlocksPerPage); - if (!page) + struct folio *folio = filemap_lock_folio(mapping, + lblock >> l2BlocksPerPage); + if (IS_ERR(folio)) continue; for (offset = 0; offset < PAGE_SIZE; offset += PSIZE) { - mp = page_to_mp(page, offset); + mp = page_to_mp(&folio->page, offset); if (!mp) continue; if (mp->index < addr) @@ -817,8 +817,8 @@ void __invalidate_metapages(struct inode *ip, s64 addr, int len) if (mp->lsn) remove_from_logsync(mp); } - unlock_page(page); - put_page(page); + folio_unlock(folio); + folio_put(folio); } } |