diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-06-30 19:59:11 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-07-08 10:33:31 -0700 |
commit | ec795418c41850056feb956534edf059dc1155d4 (patch) | |
tree | 2caa47554ebc2525cff91e4c71afab6973c24980 /fs/f2fs/super.c | |
parent | 3bdad3c7ee72a76ec87be3477eb958ed7ca304fc (diff) | |
download | op-kernel-dev-ec795418c41850056feb956534edf059dc1155d4.zip op-kernel-dev-ec795418c41850056feb956534edf059dc1155d4.tar.gz |
f2fs: use percpu_rw_semaphore
This patch replaces rw_semaphore with percpu_rw_semaphore for:
sbi->cp_rwsem
nm_i->nat_tree_lock
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index e0a975d..2bac917 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -695,6 +695,8 @@ static void destroy_percpu_info(struct f2fs_sb_info *sbi) percpu_counter_destroy(&sbi->nr_pages[i]); percpu_counter_destroy(&sbi->alloc_valid_block_count); percpu_counter_destroy(&sbi->total_valid_inode_count); + + percpu_free_rwsem(&sbi->cp_rwsem); } static void f2fs_put_super(struct super_block *sb) @@ -1471,6 +1473,9 @@ static int init_percpu_info(struct f2fs_sb_info *sbi) { int i, err; + if (percpu_init_rwsem(&sbi->cp_rwsem)) + return -ENOMEM; + for (i = 0; i < NR_COUNT_TYPE; i++) { err = percpu_counter_init(&sbi->nr_pages[i], 0, GFP_KERNEL); if (err) @@ -1671,7 +1676,6 @@ try_onemore: sbi->write_io[i].bio = NULL; } - init_rwsem(&sbi->cp_rwsem); init_waitqueue_head(&sbi->cp_wait); init_sb_info(sbi); |