Commit 9a55ed65 authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: remove unnecessary kmap/kunmap operations

The allocated page used by the recovery is not on HIGHMEM, so that we don't
need to use kmap/kunmap.
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 9851e6e1
...@@ -40,11 +40,11 @@ static struct fsync_inode_entry *get_fsync_inode(struct list_head *head, ...@@ -40,11 +40,11 @@ static struct fsync_inode_entry *get_fsync_inode(struct list_head *head,
static int recover_dentry(struct page *ipage, struct inode *inode) static int recover_dentry(struct page *ipage, struct inode *inode)
{ {
struct f2fs_node *raw_node = (struct f2fs_node *)kmap(ipage); void *kaddr = page_address(ipage);
struct f2fs_node *raw_node = (struct f2fs_node *)kaddr;
struct f2fs_inode *raw_inode = &(raw_node->i); struct f2fs_inode *raw_inode = &(raw_node->i);
nid_t pino = le32_to_cpu(raw_inode->i_pino); nid_t pino = le32_to_cpu(raw_inode->i_pino);
struct qstr name; struct qstr name;
struct f2fs_dir_entry *de;
struct page *page; struct page *page;
struct inode *dir; struct inode *dir;
int err = 0; int err = 0;
...@@ -62,8 +62,7 @@ static int recover_dentry(struct page *ipage, struct inode *inode) ...@@ -62,8 +62,7 @@ static int recover_dentry(struct page *ipage, struct inode *inode)
name.len = le32_to_cpu(raw_inode->i_namelen); name.len = le32_to_cpu(raw_inode->i_namelen);
name.name = raw_inode->i_name; name.name = raw_inode->i_name;
de = f2fs_find_entry(dir, &name, &page); if (f2fs_find_entry(dir, &name, &page)) {
if (de) {
kunmap(page); kunmap(page);
f2fs_put_page(page, 0); f2fs_put_page(page, 0);
} else { } else {
...@@ -73,7 +72,6 @@ static int recover_dentry(struct page *ipage, struct inode *inode) ...@@ -73,7 +72,6 @@ static int recover_dentry(struct page *ipage, struct inode *inode)
f2fs_msg(inode->i_sb, KERN_NOTICE, "recover_inode and its dentry: " f2fs_msg(inode->i_sb, KERN_NOTICE, "recover_inode and its dentry: "
"ino = %x, name = %s, dir = %lx, err = %d", "ino = %x, name = %s, dir = %lx, err = %d",
ino_of_node(ipage), raw_inode->i_name, dir->i_ino, err); ino_of_node(ipage), raw_inode->i_name, dir->i_ino, err);
kunmap(ipage);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment