diff options
| author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-16 11:06:50 -0700 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-13 12:33:35 +0200 |
| commit | fc0675e3fa02f78ee1c877ee20e3b6392a04374c (patch) | |
| tree | 8d8bfb43ca16a79e1cd8ba3ffcccd91f6f747e33 /fs/f2fs/recovery.c | |
| parent | 476552bd01248aa6728ba864ccddc0b90aefbb1f (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 bd444cd9e..25586bf49 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; } |
