f2fs: compress: remove unneeded preallocation
authorChao Yu <yuchao0@huawei.com>
Wed, 12 May 2021 09:52:58 +0000 (17:52 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 23 Jun 2021 08:09:33 +0000 (01:09 -0700)
commit8f1d49832636d514e949b29ce64370ebebf6d6d2
tree90a5b62a1c6cf0fa7b55df2f93defa84bb6fce50
parent8939a8489ca64b56f49428b0d882709080a928d4
f2fs: compress: remove unneeded preallocation

We will reserve iblocks for compression saved, so during compressed
cluster overwrite, we don't need to preallocate blocks for later
write.

In addition, it adds a bug_on to detect wrong reserved iblock number
in __f2fs_cluster_blocks().

Bug fix in the original patch by Jaegeuk:
If we released compressed blocks having an immutable bit, we can see less
number of compressed block addresses. Let's fix wrong BUG_ON.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/compress.c
fs/f2fs/file.c