nilfs2: remove page_address() from nilfs_add_link
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 27 Nov 2023 14:30:23 +0000 (23:30 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 11 Dec 2023 01:21:45 +0000 (17:21 -0800)
In preparation for removing kmap from directory handling, use
offset_in_page() to calculate 'from'.  Matches ext2.

Link: https://lkml.kernel.org/r/20231127143036.2425-5-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 9c0513245a3b48d7da071dafc75a59019b4fcd6d..73f1352902880e6c4025d2874a07d4d5938b07c7 100644 (file)
@@ -493,7 +493,7 @@ int nilfs_add_link(struct dentry *dentry, struct inode *inode)
        return -EINVAL;
 
 got_it:
-       from = (char *)de - (char *)page_address(page);
+       from = offset_in_page(de);
        to = from + rec_len;
        err = nilfs_prepare_chunk(page, from, to);
        if (err)