Skip to content

Commit

Permalink
nilfs2: pass the mapped address to nilfs_check_page()
Browse files Browse the repository at this point in the history
Remove another use of page_address() as part of preparing for the kmap to
kmap_local transition.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Signed-off-by: Ryusuke Konishi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Matthew Wilcox (Oracle) authored and akpm00 committed Dec 11, 2023
1 parent 09a46ac commit a8e6103
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/nilfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,11 @@ static void nilfs_commit_chunk(struct page *page,
unlock_page(page);
}

static bool nilfs_check_page(struct page *page)
static bool nilfs_check_page(struct page *page, char *kaddr)
{
struct inode *dir = page->mapping->host;
struct super_block *sb = dir->i_sb;
unsigned int chunk_size = nilfs_chunk_size(dir);
char *kaddr = page_address(page);
unsigned int offs, rec_len;
unsigned int limit = PAGE_SIZE;
struct nilfs_dir_entry *p;
Expand Down Expand Up @@ -192,7 +191,7 @@ static void *nilfs_get_page(struct inode *dir, unsigned long n,

kaddr = kmap(page);
if (unlikely(!PageChecked(page))) {
if (!nilfs_check_page(page))
if (!nilfs_check_page(page, kaddr))
goto fail;
}

Expand Down

0 comments on commit a8e6103

Please sign in to comment.