aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/recovery.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-05-16 11:06:50 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-05-18 13:57:29 -0700
commit41382ec43255b502321c3c27f1347efeb3279290 (patch)
treeb3d07c0a23995736755b1aefa8bcd4930a26cd6c /fs/f2fs/recovery.c
parentf2fs: use percpu_counter for # of dirty pages in inode (diff)
downloadlinux-dev-41382ec43255b502321c3c27f1347efeb3279290.tar.xz
linux-dev-41382ec43255b502321c3c27f1347efeb3279290.zip
f2fs: use percpu_counter for alloc_valid_block_count
This patch uses percpu_count for sbi->alloc_valid_block_count. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/recovery.c')
-rw-r--r--fs/f2fs/recovery.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index 6303b2a38c34..f89b70e72004 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -49,8 +49,9 @@ static struct kmem_cache *fsync_entry_slab;
bool space_for_roll_forward(struct f2fs_sb_info *sbi)
{
- if (sbi->last_valid_block_count + sbi->alloc_valid_block_count
- > sbi->user_block_count)
+ s64 nalloc = percpu_counter_sum_positive(&sbi->alloc_valid_block_count);
+
+ if (sbi->last_valid_block_count + nalloc > sbi->user_block_count)
return false;
return true;
}