mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-07 18:05:21 +02:00
UPSTREAM: f2fs: convert read_node_page() to use folio
Convert to use folio, so that we can get rid of 'page->index' to
prepare for removal of 'index' field in structure page [1].
[1] https://lore.kernel.org/all/Zp8fgUSIBGQ1TN0D@casper.infradead.org/
Cc: Matthew Wilcox <willy@infradead.org>
Change-Id: Iaccc296bbe6baeb66408eb77a02d5caecaa6efc4
Signed-off-by: Chao Yu <chao@kernel.org>
Reviewed-by: Li Zetao <lizetao1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 2eaa98e520
)
This commit is contained in:
parent
1e7662c3e9
commit
9df793d8c1
|
@ -1369,6 +1369,7 @@ fail:
|
|||
*/
|
||||
static int read_node_page(struct page *page, blk_opf_t op_flags)
|
||||
{
|
||||
struct folio *folio = page_folio(page);
|
||||
struct f2fs_sb_info *sbi = F2FS_P_SB(page);
|
||||
struct node_info ni;
|
||||
struct f2fs_io_info fio = {
|
||||
|
@ -1381,21 +1382,21 @@ static int read_node_page(struct page *page, blk_opf_t op_flags)
|
|||
};
|
||||
int err;
|
||||
|
||||
if (PageUptodate(page)) {
|
||||
if (folio_test_uptodate(folio)) {
|
||||
if (!f2fs_inode_chksum_verify(sbi, page)) {
|
||||
ClearPageUptodate(page);
|
||||
folio_clear_uptodate(folio);
|
||||
return -EFSBADCRC;
|
||||
}
|
||||
return LOCKED_PAGE;
|
||||
}
|
||||
|
||||
err = f2fs_get_node_info(sbi, page->index, &ni, false);
|
||||
err = f2fs_get_node_info(sbi, folio->index, &ni, false);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
/* NEW_ADDR can be seen, after cp_error drops some dirty node pages */
|
||||
if (unlikely(ni.blk_addr == NULL_ADDR || ni.blk_addr == NEW_ADDR)) {
|
||||
ClearPageUptodate(page);
|
||||
folio_clear_uptodate(folio);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user