diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-16 11:06:50 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-18 13:57:29 -0700 |
commit | 41382ec43255b502321c3c27f1347efeb3279290 (patch) | |
tree | b3d07c0a23995736755b1aefa8bcd4930a26cd6c /fs/f2fs/recovery.c | |
parent | 1beba1b3a953107c3ff5448ab4e4297db4619c76 (diff) |
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.c | 5 |
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; } |