diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-04-15 11:19:28 +0900 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-05-07 10:21:54 +0900 |
commit | ed57c27f736f6d8a51e442610c800ee0c3d83977 (patch) | |
tree | f1d453fae0ba5b9d5ca938fb0d57aedd762a5c58 /fs/f2fs/recovery.c | |
parent | 15c6e3aae68d6167cba063387a59968f811c8268 (diff) | |
download | blackbird-op-linux-ed57c27f736f6d8a51e442610c800ee0c3d83977.tar.gz blackbird-op-linux-ed57c27f736f6d8a51e442610c800ee0c3d83977.zip |
f2fs: remove costly dirty_dir_inode operations
This patch removes list opeations in handling dirty dir inodes.
Previously, F2FS traverses whole the list of dirty dir inodes to check whether
there is an existing inode or not, resulting in heavy CPU overheads.
So this patch removes such the traverse operations by adding FI_DIRTY_DIR to
indicate the inode lies on the list or not.
Through this simple flag, we can remove redundant operations gracefully.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/recovery.c')
-rw-r--r-- | fs/f2fs/recovery.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index b1ae89f0f44e..9eb6487f383d 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c @@ -46,15 +46,17 @@ static int recover_dentry(struct page *ipage, struct inode *inode) struct inode *dir, *einode; int err = 0; - dir = check_dirty_dir_inode(F2FS_SB(inode->i_sb), pino); - if (!dir) { - dir = f2fs_iget(inode->i_sb, pino); - if (IS_ERR(dir)) { - err = PTR_ERR(dir); - goto out; - } - set_inode_flag(F2FS_I(dir), FI_DELAY_IPUT); + dir = f2fs_iget(inode->i_sb, pino); + if (IS_ERR(dir)) { + err = PTR_ERR(dir); + goto out; + } + + if (is_inode_flag_set(F2FS_I(dir), FI_DIRTY_DIR)) { + iput(dir); + } else { add_dirty_dir_inode(dir); + set_inode_flag(F2FS_I(dir), FI_DELAY_IPUT); } name.len = le32_to_cpu(raw_inode->i_namelen); |