Skip to content

Commit f86a3a1

Browse files
Matthew Wilcox (Oracle)kleikamp
authored andcommitted
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) <[email protected]> Signed-off-by: Dave Kleikamp <[email protected]>
1 parent 1f0dc61 commit f86a3a1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fs/jfs/jfs_metapage.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,6 @@ void __invalidate_metapages(struct inode *ip, s64 addr, int len)
791791
struct address_space *mapping =
792792
JFS_SBI(ip->i_sb)->direct_inode->i_mapping;
793793
struct metapage *mp;
794-
struct page *page;
795794
unsigned int offset;
796795

797796
/*
@@ -800,11 +799,12 @@ void __invalidate_metapages(struct inode *ip, s64 addr, int len)
800799
*/
801800
for (lblock = addr & ~(BlocksPerPage - 1); lblock < addr + len;
802801
lblock += BlocksPerPage) {
803-
page = find_lock_page(mapping, lblock >> l2BlocksPerPage);
804-
if (!page)
802+
struct folio *folio = filemap_lock_folio(mapping,
803+
lblock >> l2BlocksPerPage);
804+
if (IS_ERR(folio))
805805
continue;
806806
for (offset = 0; offset < PAGE_SIZE; offset += PSIZE) {
807-
mp = page_to_mp(page, offset);
807+
mp = page_to_mp(&folio->page, offset);
808808
if (!mp)
809809
continue;
810810
if (mp->index < addr)
@@ -817,8 +817,8 @@ void __invalidate_metapages(struct inode *ip, s64 addr, int len)
817817
if (mp->lsn)
818818
remove_from_logsync(mp);
819819
}
820-
unlock_page(page);
821-
put_page(page);
820+
folio_unlock(folio);
821+
folio_put(folio);
822822
}
823823
}
824824

0 commit comments

Comments
 (0)