diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-16 21:06:50 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-18 23:57:29 +0300 |
commit | 41382ec43255b502321c3c27f1347efeb3279290 (patch) | |
tree | b3d07c0a23995736755b1aefa8bcd4930a26cd6c /fs/f2fs/super.c | |
parent | 1beba1b3a953107c3ff5448ab4e4297db4619c76 (diff) | |
download | linux-41382ec43255b502321c3c27f1347efeb3279290.tar.xz |
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/super.c')
-rw-r--r-- | fs/f2fs/super.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 0ff862b08fb9..43e3e9c382d8 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -617,6 +617,7 @@ static void destroy_percpu_info(struct f2fs_sb_info *sbi) for (i = 0; i < NR_COUNT_TYPE; i++) percpu_counter_destroy(&sbi->nr_pages[i]); + percpu_counter_destroy(&sbi->alloc_valid_block_count); } static void f2fs_put_super(struct super_block *sb) @@ -1382,7 +1383,9 @@ static int init_percpu_info(struct f2fs_sb_info *sbi) if (err) return err; } - return 0; + + return percpu_counter_init(&sbi->alloc_valid_block_count, 0, + GFP_KERNEL); } /* @@ -1601,7 +1604,7 @@ try_onemore: sbi->total_valid_block_count = le64_to_cpu(sbi->ckpt->valid_block_count); sbi->last_valid_block_count = sbi->total_valid_block_count; - sbi->alloc_valid_block_count = 0; + for (i = 0; i < NR_INODE_TYPE; i++) { INIT_LIST_HEAD(&sbi->inode_list[i]); spin_lock_init(&sbi->inode_lock[i]); |