diff options
| author | Chao Yu <yuchao0@huawei.com> | 2016-10-11 22:57:01 +0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-13 12:34:15 +0200 |
| commit | ab9b10421e8f2ad6ac5986c8219d57dd4b2526e0 (patch) | |
| tree | b35ac112ed9db0a0e2bdce1ade8b75dcae1270e6 /fs/f2fs/data.c | |
| parent | a3ecc330b58ca6f0d50e027c4d3125251f89bda8 (diff) | |
f2fs: give a chance to detach from dirty list
If there is no dirty pages in inode, we should give a chance to detach
the inode from global dirty list, otherwise it needs to call another
unnecessary .writepages for detaching.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
| -rw-r--r-- | fs/f2fs/data.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 73705dcaa..75cddacda 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1800,12 +1800,14 @@ void f2fs_invalidate_page(struct page *page, unsigned long offset) return; if (PageDirty(page)) { - if (inode->i_ino == F2FS_META_INO(sbi)) + if (inode->i_ino == F2FS_META_INO(sbi)) { dec_page_count(sbi, F2FS_DIRTY_META); - else if (inode->i_ino == F2FS_NODE_INO(sbi)) + } else if (inode->i_ino == F2FS_NODE_INO(sbi)) { dec_page_count(sbi, F2FS_DIRTY_NODES); - else + } else { inode_dec_dirty_pages(inode); + remove_dirty_inode(inode); + } } /* This is atomic written page, keep Private */ |
