summaryrefslogtreecommitdiff
path: root/fs/ext2/dir.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2022-12-14 04:31:39 +0300
committerJan Kara <jack@suse.cz>2023-05-29 12:03:28 +0300
commitdae42837ba6dd441e4a569996d5f62986ffe01ed (patch)
tree8cfd1c8bf958322fe1389aba4acf67970aa6e87a /fs/ext2/dir.c
parent91f646fb971f4401216a2dff5c568bcbce79a923 (diff)
downloadlinux-dae42837ba6dd441e4a569996d5f62986ffe01ed.tar.xz
ext2_{set_link,delete_entry}(): don't bother with page_addr
ext2_set_link() simply doesn't use it anymore and ext2_delete_entry() can easily obtain it from the directory entry pointer... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Tested-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext2/dir.c')
-rw-r--r--fs/ext2/dir.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index 31b2aab94da0..8cf91a7bbbb9 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -464,8 +464,7 @@ static int ext2_handle_dirsync(struct inode *dir)
}
int ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de,
- struct page *page, void *page_addr, struct inode *inode,
- bool update_times)
+ struct page *page, struct inode *inode, bool update_times)
{
loff_t pos = page_offset(page) + offset_in_page(de);
unsigned len = ext2_rec_len_from_disk(de->rec_len);
@@ -586,16 +585,16 @@ out_unlock:
* ext2_delete_entry deletes a directory entry by merging it with the
* previous entry. Page is up-to-date.
*/
-int ext2_delete_entry (struct ext2_dir_entry_2 *dir, struct page *page,
- char *kaddr)
+int ext2_delete_entry(struct ext2_dir_entry_2 *dir, struct page *page)
{
struct inode *inode = page->mapping->host;
+ char *kaddr = (char *)((unsigned long)dir & PAGE_MASK);
unsigned from = offset_in_page(dir) & ~(ext2_chunk_size(inode)-1);
unsigned to = offset_in_page(dir) +
ext2_rec_len_from_disk(dir->rec_len);
loff_t pos;
- ext2_dirent * pde = NULL;
- ext2_dirent * de = (ext2_dirent *) (kaddr + from);
+ ext2_dirent *pde = NULL;
+ ext2_dirent *de = (ext2_dirent *)(kaddr + from);
int err;
while ((char*)de < (char*)dir) {