]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: reduce region of cp_rwsem covered in f2fs_do_collapse
authorChao Yu <chao2.yu@samsung.com>
Thu, 16 Jul 2015 10:18:11 +0000 (18:18 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 5 Aug 2015 15:08:09 +0000 (08:08 -0700)
commit7efbd4db815bf70197847c6c3906856d086ad344
treebce9e4897f4174455362b913996bebb241ab628b
parent7a13c5c6c98268cc5678da2710c9840679c45a7e
f2fs: reduce region of cp_rwsem covered in f2fs_do_collapse

In f2fs_do_collapse, region cp_rwsem covered is large, since it will be
held until all blocks are left shifted, so if we try to collapse small
area at the beginning of large file, checkpoint who want to grab writer's
lock of cp_rwsem will be delayed for long time.

In order to avoid this condition, altering to lock/unlock cp_rwsem each
shift operation.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c