diff options
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index d175ae3b612a..b401be71ecbd 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -799,10 +799,7 @@ static int f2fs_write_data_page(struct page *page, | |||
799 | */ | 799 | */ |
800 | offset = i_size & (PAGE_CACHE_SIZE - 1); | 800 | offset = i_size & (PAGE_CACHE_SIZE - 1); |
801 | if ((page->index >= end_index + 1) || !offset) { | 801 | if ((page->index >= end_index + 1) || !offset) { |
802 | if (S_ISDIR(inode->i_mode)) { | 802 | inode_dec_dirty_dents(inode); |
803 | dec_page_count(sbi, F2FS_DIRTY_DENTS); | ||
804 | inode_dec_dirty_dents(inode); | ||
805 | } | ||
806 | goto out; | 803 | goto out; |
807 | } | 804 | } |
808 | 805 | ||
@@ -815,7 +812,6 @@ write: | |||
815 | 812 | ||
816 | /* Dentry blocks are controlled by checkpoint */ | 813 | /* Dentry blocks are controlled by checkpoint */ |
817 | if (S_ISDIR(inode->i_mode)) { | 814 | if (S_ISDIR(inode->i_mode)) { |
818 | dec_page_count(sbi, F2FS_DIRTY_DENTS); | ||
819 | inode_dec_dirty_dents(inode); | 815 | inode_dec_dirty_dents(inode); |
820 | err = do_write_data_page(page, &fio); | 816 | err = do_write_data_page(page, &fio); |
821 | } else { | 817 | } else { |
@@ -1033,11 +1029,8 @@ static void f2fs_invalidate_data_page(struct page *page, unsigned int offset, | |||
1033 | unsigned int length) | 1029 | unsigned int length) |
1034 | { | 1030 | { |
1035 | struct inode *inode = page->mapping->host; | 1031 | struct inode *inode = page->mapping->host; |
1036 | struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); | 1032 | if (PageDirty(page)) |
1037 | if (S_ISDIR(inode->i_mode) && PageDirty(page)) { | ||
1038 | dec_page_count(sbi, F2FS_DIRTY_DENTS); | ||
1039 | inode_dec_dirty_dents(inode); | 1033 | inode_dec_dirty_dents(inode); |
1040 | } | ||
1041 | ClearPagePrivate(page); | 1034 | ClearPagePrivate(page); |
1042 | } | 1035 | } |
1043 | 1036 | ||