nilfs2: pass the mapped address to nilfs_check_page()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 27 Nov 2023 14:30:26 +0000 (23:30 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 11 Dec 2023 01:21:46 +0000 (17:21 -0800)
Remove another use of page_address() as part of preparing for the kmap to
kmap_local transition.

Link: https://lkml.kernel.org/r/20231127143036.2425-8-konishi.ryusuke@gmail.com
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/nilfs2/dir.c

index 45f75d4c452229c4e2c4299a224b7bc0c23229fd..01900e84bddfd35b5dc5b3a5be0671e18205d288 100644 (file)
@@ -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;
@@ -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;
        }