diff options
author | Chao Yu <chao@kernel.org> | 2022-06-19 01:51:55 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-06-28 09:27:10 -0700 |
commit | 29be7ec3df7a3ed95584d39aa4014df0cd056991 (patch) | |
tree | edddfc21b6c86d9de7cd8fa3adafa81ed091676b /fs/f2fs/compress.c | |
parent | a4a0e16dbf77582c4f58ab472229dd071b5c4260 (diff) | |
download | lwn-29be7ec3df7a3ed95584d39aa4014df0cd056991.tar.gz lwn-29be7ec3df7a3ed95584d39aa4014df0cd056991.zip |
f2fs: initialize page_array_entry slab only if compression feature is on
Otherwise, in image which doesn't support compression feature,
page_array_entry will be initialized w/o use.
Signed-off-by: Chao Yu <chao.yu@oppo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/compress.c')
-rw-r--r-- | fs/f2fs/compress.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 24824cd96f36..fa237e5c7173 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1908,6 +1908,9 @@ int f2fs_init_page_array_cache(struct f2fs_sb_info *sbi) dev_t dev = sbi->sb->s_bdev->bd_dev; char slab_name[32]; + if (!f2fs_sb_has_compression(sbi)) + return 0; + sprintf(slab_name, "f2fs_page_array_entry-%u:%u", MAJOR(dev), MINOR(dev)); sbi->page_array_slab_size = sizeof(struct page *) << |