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)
commitecbaa4068f88f96a8ffde37d532e618508394b53
treebce9e4897f4174455362b913996bebb241ab628b
parent0f825ee6e873ac0daf5394c5ec76ca2f3d540370
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