diff options
author | Chao Yu <yuchao0@huawei.com> | 2016-08-18 17:46:14 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-08-29 18:31:07 -0700 |
commit | 7c4abcbeccdd286e7d71b3e8f9fefad84112e54c (patch) | |
tree | bf540dc2aaf3f35681315f791ef4b0e33d5935ae /fs | |
parent | 58cce381fa4e8cfbe7ce005a6a858267a3b481f2 (diff) | |
download | linux-7c4abcbeccdd286e7d71b3e8f9fefad84112e54c.tar.gz linux-7c4abcbeccdd286e7d71b3e8f9fefad84112e54c.tar.bz2 linux-7c4abcbeccdd286e7d71b3e8f9fefad84112e54c.zip |
f2fs: set dirty state for filesystem only when updating meta data
We don't guarantee integrity of user data after checkpoint, since we only
guarantee meta data integrity for data consistency of filesystem.
Due to above reason, we only need to set fs as dirty when meta data is
updated, so that we can skip writing checkpoint in some case of non-meta
data is updated.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/f2fs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 0f4599099dbc..5d2db47e9929 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1200,6 +1200,10 @@ static inline void dec_valid_block_count(struct f2fs_sb_info *sbi, static inline void inc_page_count(struct f2fs_sb_info *sbi, int count_type) { percpu_counter_inc(&sbi->nr_pages[count_type]); + + if (count_type == F2FS_DIRTY_DATA || count_type == F2FS_INMEM_PAGES) + return; + set_sbi_flag(sbi, SBI_IS_DIRTY); } |