Skip to content
Snippets Groups Projects
Commit 6af2191f authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Andrew Morton
Browse files

nilfs2: remove page_address() from nilfs_delete_entry

In preparation for removing kmap from directory handling, mask the
directory entry pointer to discover the start address of the page. 
Matches ext2.

Link: https://lkml.kernel.org/r/20231127143036.2425-6-konishi.ryusuke@gmail.com


Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 2197f5ae
No related branches found
No related tags found
No related merge requests found
...@@ -531,7 +531,7 @@ int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page) ...@@ -531,7 +531,7 @@ int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page)
{ {
struct address_space *mapping = page->mapping; struct address_space *mapping = page->mapping;
struct inode *inode = mapping->host; struct inode *inode = mapping->host;
char *kaddr = page_address(page); char *kaddr = (char *)((unsigned long)dir & PAGE_MASK);
unsigned int from, to; unsigned int from, to;
struct nilfs_dir_entry *de, *pde = NULL; struct nilfs_dir_entry *de, *pde = NULL;
int err; int err;
...@@ -551,7 +551,7 @@ int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page) ...@@ -551,7 +551,7 @@ int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page)
de = nilfs_next_entry(de); de = nilfs_next_entry(de);
} }
if (pde) if (pde)
from = (char *)pde - (char *)page_address(page); from = (char *)pde - kaddr;
lock_page(page); lock_page(page);
err = nilfs_prepare_chunk(page, from, to); err = nilfs_prepare_chunk(page, from, to);
BUG_ON(err); BUG_ON(err);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment