diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-11-21 16:36:28 -0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-11-23 21:51:53 -0800 |
commit | 9486ba442b00a6b227bfe0d66b0f4dbcd1a2ee91 (patch) | |
tree | 0f308e43c33144b4535562897e9b370ce624d506 /fs/f2fs/namei.c | |
parent | c9ee00857c9630fba14ebe368d06dc3ac2489b84 (diff) | |
download | op-kernel-dev-9486ba442b00a6b227bfe0d66b0f4dbcd1a2ee91.zip op-kernel-dev-9486ba442b00a6b227bfe0d66b0f4dbcd1a2ee91.tar.gz |
f2fs: introduce f2fs_dentry_kunmap to clean up
This patch introduces f2fs_dentry_kunmap to clean up dirty codes.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/namei.c')
-rw-r--r-- | fs/f2fs/namei.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 2bee559..547a2de 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -200,8 +200,7 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, de = f2fs_find_entry(dir, &dentry->d_name, &page); if (de) { nid_t ino = le32_to_cpu(de->ino); - if (!f2fs_has_inline_dentry(dir)) - kunmap(page); + f2fs_dentry_kunmap(dir, page); f2fs_put_page(page, 0); inode = f2fs_iget(dir->i_sb, ino); @@ -231,8 +230,7 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry) err = acquire_orphan_inode(sbi); if (err) { f2fs_unlock_op(sbi); - if (!f2fs_has_inline_dentry(dir)) - kunmap(page); + f2fs_dentry_kunmap(dir, page); f2fs_put_page(page, 0); goto fail; } @@ -469,8 +467,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry, old_dir_page, new_dir); update_inode_page(old_inode); } else { - if (!f2fs_has_inline_dentry(old_inode)) - kunmap(old_dir_page); + f2fs_dentry_kunmap(old_inode, old_dir_page); f2fs_put_page(old_dir_page, 0); } drop_nlink(old_dir); @@ -486,18 +483,15 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry, put_out_dir: f2fs_unlock_op(sbi); - if (!f2fs_has_inline_dentry(new_dir)) - kunmap(new_page); + f2fs_dentry_kunmap(new_dir, new_page); f2fs_put_page(new_page, 0); out_dir: if (old_dir_entry) { - if (!f2fs_has_inline_dentry(old_inode)) - kunmap(old_dir_page); + f2fs_dentry_kunmap(old_inode, old_dir_page); f2fs_put_page(old_dir_page, 0); } out_old: - if (!f2fs_has_inline_dentry(old_dir)) - kunmap(old_page); + f2fs_dentry_kunmap(old_dir, old_page); f2fs_put_page(old_page, 0); out: return err; @@ -632,23 +626,19 @@ out_unlock: f2fs_unlock_op(sbi); out_new_dir: if (new_dir_entry) { - if (!f2fs_has_inline_dentry(new_inode)) - kunmap(new_dir_page); + f2fs_dentry_kunmap(new_inode, new_dir_page); f2fs_put_page(new_dir_page, 0); } out_old_dir: if (old_dir_entry) { - if (!f2fs_has_inline_dentry(old_inode)) - kunmap(old_dir_page); + f2fs_dentry_kunmap(old_inode, old_dir_page); f2fs_put_page(old_dir_page, 0); } out_new: - if (!f2fs_has_inline_dentry(new_dir)) - kunmap(new_page); + f2fs_dentry_kunmap(new_dir, new_page); f2fs_put_page(new_page, 0); out_old: - if (!f2fs_has_inline_dentry(old_dir)) - kunmap(old_page); + f2fs_dentry_kunmap(old_dir, old_page); f2fs_put_page(old_page, 0); out: return err; |