summaryrefslogtreecommitdiff
path: root/fs/nilfs2/namei.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2023-11-27 23:30:27 +0900
committerAndrew Morton <akpm@linux-foundation.org>2023-12-10 17:21:46 -0800
commit9b77f66f992733069543638afe591f94e1d30291 (patch)
treeaff484cff7d30a3fa744c0acb17cade81148dfa0 /fs/nilfs2/namei.c
parenta8e610353bf94c279d0ca6d3711aa84728d80a46 (diff)
nilfs2: switch to kmap_local for directory handling
Match ext2 by using kmap_local() instead of kmap(). This is more efficient. Also use unmap_and_put_page() instead of duplicating it as a nilfs function. [konishi.ryusuke: followed the change of page release helper call sites] Link: https://lkml.kernel.org/r/20231127143036.2425-9-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>
Diffstat (limited to 'fs/nilfs2/namei.c')
-rw-r--r--fs/nilfs2/namei.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c
index d179db8074c2..c08b1bf9fa7b 100644
--- a/fs/nilfs2/namei.c
+++ b/fs/nilfs2/namei.c
@@ -280,7 +280,7 @@ static int nilfs_do_unlink(struct inode *dir, struct dentry *dentry)
set_nlink(inode, 1);
}
err = nilfs_delete_entry(de, page);
- nilfs_put_page(page);
+ unmap_and_put_page(page, de);
if (err)
goto out;
@@ -387,7 +387,7 @@ static int nilfs_rename(struct mnt_idmap *idmap,
if (!new_de)
goto out_dir;
nilfs_set_link(new_dir, new_de, new_page, old_inode);
- nilfs_put_page(new_page);
+ unmap_and_put_page(new_page, new_de);
nilfs_mark_inode_dirty(new_dir);
inode_set_ctime_current(new_inode);
if (dir_de)
@@ -414,10 +414,10 @@ static int nilfs_rename(struct mnt_idmap *idmap,
if (dir_de) {
nilfs_set_link(old_inode, dir_de, dir_page, new_dir);
- nilfs_put_page(dir_page);
+ unmap_and_put_page(dir_page, dir_de);
drop_nlink(old_dir);
}
- nilfs_put_page(old_page);
+ unmap_and_put_page(old_page, old_de);
nilfs_mark_inode_dirty(old_dir);
nilfs_mark_inode_dirty(old_inode);
@@ -427,9 +427,9 @@ static int nilfs_rename(struct mnt_idmap *idmap,
out_dir:
if (dir_de)
- nilfs_put_page(dir_page);
+ unmap_and_put_page(dir_page, dir_de);
out_old:
- nilfs_put_page(old_page);
+ unmap_and_put_page(old_page, old_de);
out:
nilfs_transaction_abort(old_dir->i_sb);
return err;