summaryrefslogtreecommitdiff
path: root/fs/f2fs/checkpoint.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-12-15 08:31:40 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2015-12-16 00:31:28 +0300
commit6ad7609a183a250f1a346c7edfcbeaa30a29cfcc (patch)
treeff5dac745a87329a6a29738f3c3f86536ee8f28f /fs/f2fs/checkpoint.c
parent2710fd7e00b4f77dbe807efaf546bed00b62e65e (diff)
downloadlinux-6ad7609a183a250f1a346c7edfcbeaa30a29cfcc.tar.xz
f2fs: introduce __remove_dirty_inode
Introduce __remove_dirty_inode to clean up codes in remove_dirty_dir_inode. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r--fs/f2fs/checkpoint.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 1aca402cab9c..a4392f06f733 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -736,6 +736,20 @@ static void __add_dirty_inode(struct inode *inode)
return;
}
+static void __remove_dirty_inode(struct inode *inode)
+{
+ struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
+ struct f2fs_inode_info *fi = F2FS_I(inode);
+
+ if (get_dirty_pages(inode) ||
+ !is_inode_flag_set(F2FS_I(inode), FI_DIRTY_DIR))
+ return;
+
+ list_del_init(&fi->dirty_list);
+ clear_inode_flag(fi, FI_DIRTY_DIR);
+ stat_dec_dirty_dir(sbi);
+}
+
void update_dirty_page(struct inode *inode, struct page *page)
{
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
@@ -777,15 +791,7 @@ void remove_dirty_dir_inode(struct inode *inode)
return;
spin_lock(&sbi->dir_inode_lock);
- if (get_dirty_pages(inode) ||
- !is_inode_flag_set(F2FS_I(inode), FI_DIRTY_DIR)) {
- spin_unlock(&sbi->dir_inode_lock);
- return;
- }
-
- list_del_init(&fi->dirty_list);
- clear_inode_flag(fi, FI_DIRTY_DIR);
- stat_dec_dirty_dir(sbi);
+ __remove_dirty_inode(inode);
spin_unlock(&sbi->dir_inode_lock);
/* Only from the recovery routine */