diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2024-04-17 18:56:47 +0100 |
---|---|---|
committer | Dave Kleikamp <dave.kleikamp@oracle.com> | 2024-05-24 10:26:04 -0500 |
commit | 2dcd9630d988509aa87de2ce7826a697f8ce58ea (patch) | |
tree | bbf1b5f388533fd2902602ca307cc8cf755bf5d8 /fs/jfs | |
parent | 35474d52c6056976e675e9130d755cdb749ded5a (diff) | |
download | lwn-2dcd9630d988509aa87de2ce7826a697f8ce58ea.tar.gz lwn-2dcd9630d988509aa87de2ce7826a697f8ce58ea.zip |
jfs: Convert __get_metapage to use a folio
Remove four hidden calls to compound_head().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Diffstat (limited to 'fs/jfs')
-rw-r--r-- | fs/jfs/jfs_metapage.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c index beecc9ad656e..4ef85e264f51 100644 --- a/fs/jfs/jfs_metapage.c +++ b/fs/jfs/jfs_metapage.c @@ -577,7 +577,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock, int l2bsize; struct address_space *mapping; struct metapage *mp = NULL; - struct page *page; + struct folio *folio; unsigned long page_index; unsigned long page_offset; @@ -608,22 +608,22 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock, } if (new && (PSIZE == PAGE_SIZE)) { - page = grab_cache_page(mapping, page_index); - if (!page) { - jfs_err("grab_cache_page failed!"); + folio = filemap_grab_folio(mapping, page_index); + if (IS_ERR(folio)) { + jfs_err("filemap_grab_folio failed!"); return NULL; } - SetPageUptodate(page); + folio_mark_uptodate(folio); } else { - page = read_mapping_page(mapping, page_index, NULL); - if (IS_ERR(page)) { + folio = read_mapping_folio(mapping, page_index, NULL); + if (IS_ERR(folio)) { jfs_err("read_mapping_page failed!"); return NULL; } - lock_page(page); + folio_lock(folio); } - mp = page_to_mp(page, page_offset); + mp = page_to_mp(&folio->page, page_offset); if (mp) { if (mp->logical_size != size) { jfs_error(inode->i_sb, @@ -649,16 +649,16 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock, mp = alloc_metapage(GFP_NOFS); if (!mp) goto unlock; - mp->page = page; + mp->page = &folio->page; mp->sb = inode->i_sb; mp->flag = 0; mp->xflag = COMMIT_PAGE; mp->count = 1; mp->nohomeok = 0; mp->logical_size = size; - mp->data = page_address(page) + page_offset; + mp->data = folio_address(folio) + page_offset; mp->index = lblock; - if (unlikely(insert_metapage(page, mp))) { + if (unlikely(insert_metapage(&folio->page, mp))) { free_metapage(mp); goto unlock; } @@ -670,12 +670,12 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock, memset(mp->data, 0, PSIZE); } - unlock_page(page); + folio_unlock(folio); jfs_info("__get_metapage: returning = 0x%p data = 0x%p", mp, mp->data); return mp; unlock: - unlock_page(page); + folio_unlock(folio); return NULL; } |