diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-11-18 03:16:17 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-12-22 20:18:01 -0500 |
commit | 971767caf632190f77a40b4011c19948232eed75 (patch) | |
tree | 2a3eb454e7924271978932a81b825b1b0136db98 /fs/f2fs/super.c | |
parent | 7d5e510944ce60ef0c6c2300a58547679df76db7 (diff) |
f2fs: use sbi->write_mutex for write bios
This patch removes an unnecessary semaphore (i.e., sbi->bio_sem).
There is no reason to use the semaphore when f2fs submits read and write IOs.
Instead, let's use a write mutex and cover the sbi->bio[] by the lock.
Change log from v1:
o split write_mutex suggested by Chao Yu
Chao described,
"All DATA/NODE/META bio buffers in superblock is protected by
'sbi->write_mutex', but each bio buffer area is independent, So we
should split write_mutex to three for DATA/NODE/META."
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
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 a022412c66ea..e194578b3594 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c | |||
@@ -820,6 +820,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) | |||
820 | struct buffer_head *raw_super_buf; | 820 | struct buffer_head *raw_super_buf; |
821 | struct inode *root; | 821 | struct inode *root; |
822 | long err = -EINVAL; | 822 | long err = -EINVAL; |
823 | int i; | ||
823 | 824 | ||
824 | /* allocate memory for f2fs-specific super block info */ | 825 | /* allocate memory for f2fs-specific super block info */ |
825 | sbi = kzalloc(sizeof(struct f2fs_sb_info), GFP_KERNEL); | 826 | sbi = kzalloc(sizeof(struct f2fs_sb_info), GFP_KERNEL); |
@@ -876,7 +877,10 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) | |||
876 | mutex_init(&sbi->node_write); | 877 | mutex_init(&sbi->node_write); |
877 | sbi->por_doing = false; | 878 | sbi->por_doing = false; |
878 | spin_lock_init(&sbi->stat_lock); | 879 | spin_lock_init(&sbi->stat_lock); |
879 | init_rwsem(&sbi->bio_sem); | 880 | |
881 | for (i = 0; i < NR_PAGE_TYPE; i++) | ||
882 | mutex_init(&sbi->write_mutex[i]); | ||
883 | |||
880 | init_rwsem(&sbi->cp_rwsem); | 884 | init_rwsem(&sbi->cp_rwsem); |
881 | init_waitqueue_head(&sbi->cp_wait); | 885 | init_waitqueue_head(&sbi->cp_wait); |
882 | init_sb_info(sbi); | 886 | init_sb_info(sbi); |