diff options
| author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-16 10:33:40 -0700 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-13 12:33:34 +0200 |
| commit | e9f48dff615de7397a09df0ac459ca594c67644a (patch) | |
| tree | d5ca221a7ddfe53408a661dc2bdcf3d843254e1c | |
| parent | 10536dff98603da7029e28f0588926e5e00eb685 (diff) | |
f2fs: manipulate dirty file inodes when DATA_FLUSH is set
It needs to maintain dirty file inodes only if DATA_FLUSH is set.
Otherwise, let's avoid its overhead.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
| -rw-r--r-- | fs/f2fs/checkpoint.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index b413b4692..55c6eff36 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -786,9 +786,11 @@ void update_dirty_page(struct inode *inode, struct page *page) !S_ISLNK(inode->i_mode)) return; - spin_lock(&sbi->inode_lock[type]); - __add_dirty_inode(inode, type); - spin_unlock(&sbi->inode_lock[type]); + if (type != FILE_INODE || test_opt(sbi, DATA_FLUSH)) { + spin_lock(&sbi->inode_lock[type]); + __add_dirty_inode(inode, type); + spin_unlock(&sbi->inode_lock[type]); + } inode_inc_dirty_pages(inode); SetPagePrivate(page); @@ -804,6 +806,9 @@ void remove_dirty_inode(struct inode *inode) !S_ISLNK(inode->i_mode)) return; + if (type == FILE_INODE && !test_opt(sbi, DATA_FLUSH)) + return; + spin_lock(&sbi->inode_lock[type]); __remove_dirty_inode(inode, type); spin_unlock(&sbi->inode_lock[type]); |
