mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
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>
This commit is contained in:
parent
1f0dc610da
commit
f86a3a1824
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user