]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
f2fs: clean up i_compress_flag and i_compress_level usage
authorChao Yu <chao@kernel.org>
Sat, 28 Jan 2023 10:30:11 +0000 (18:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jan 2024 16:10:30 +0000 (17:10 +0100)
commit84a8d913fb532793122f45b59b73224b63c3307e
tree7ace287b8ebc274668b85d3f060dfc8a4b213fce
parent2c14f4991610f2296d78d8e7e28d06dd2d60f707
f2fs: clean up i_compress_flag and i_compress_level usage

[ Upstream commit b90e5086df6bf5ba819216d5ecf0667370bd565f ]

.i_compress_level was introduced by commit 3fde13f817e2 ("f2fs: compress:
support compress level"), but never be used.

This patch updates as below:
- load high 8-bits of on-disk .i_compress_flag to in-memory .i_compress_level
- load low 8-bits of on-disk .i_compress_flag to in-memory .i_compress_flag
- change type of in-memory .i_compress_flag from unsigned short to unsigned
char.

w/ above changes, we can avoid unneeded bit shift whenever during
.init_compress_ctx(), and shrink size of struct f2fs_inode_info.

Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Stable-dep-of: f5f3bd903a5d ("f2fs: set the default compress_level on ioctl")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/compress.c
fs/f2fs/f2fs.h
fs/f2fs/inode.c