mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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>
This commit is contained in:
parent
807a2aa41d
commit
7a5dfa9285
1 changed files with 15 additions and 9 deletions
|
@ -737,6 +737,20 @@ static void __add_dirty_inode(struct inode *inode)
|
||||||
return;
|
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)
|
void update_dirty_page(struct inode *inode, struct page *page)
|
||||||
{
|
{
|
||||||
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
|
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
|
||||||
|
@ -778,15 +792,7 @@ void remove_dirty_dir_inode(struct inode *inode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
spin_lock(&sbi->dir_inode_lock);
|
spin_lock(&sbi->dir_inode_lock);
|
||||||
if (get_dirty_pages(inode) ||
|
__remove_dirty_inode(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);
|
|
||||||
spin_unlock(&sbi->dir_inode_lock);
|
spin_unlock(&sbi->dir_inode_lock);
|
||||||
|
|
||||||
/* Only from the recovery routine */
|
/* Only from the recovery routine */
|
||||||
|
|
Loading…
Reference in a new issue