summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2023-03-31 00:49:47 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2023-04-10 10:58:45 -0700
commit3094e5579b4d5d8343fdb05e9a3a35cc85a14c1c (patch)
tree20ebed0b90c99c6b1a862b78fd06b21e3b686c0e /fs/f2fs
parent084e15ea14bbb1ad40163438cfa74a76a1521c16 (diff)
f2fs: merge lz4hc_compress_pages() to lz4_compress_pages()
Remove unnecessary lz4hc_compress_pages(). Signed-off-by: Yangtao Li <frank.li@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> [Jaegeuk Kim: clean up] Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/compress.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index 3182e1506252..11653fa79289 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -264,35 +264,21 @@ static void lz4_destroy_compress_ctx(struct compress_ctx *cc)
cc->private = NULL;
}
-#ifdef CONFIG_F2FS_FS_LZ4HC
-static int lz4hc_compress_pages(struct compress_ctx *cc)
+static int lz4_compress_pages(struct compress_ctx *cc)
{
+ int len = -EINVAL;
unsigned char level = F2FS_I(cc->inode)->i_compress_level;
- int len;
- if (level)
- len = LZ4_compress_HC(cc->rbuf, cc->cbuf->cdata, cc->rlen,
- cc->clen, level, cc->private);
- else
+ if (!level)
len = LZ4_compress_default(cc->rbuf, cc->cbuf->cdata, cc->rlen,
cc->clen, cc->private);
- if (!len)
- return -EAGAIN;
-
- cc->clen = len;
- return 0;
-}
-#endif
-
-static int lz4_compress_pages(struct compress_ctx *cc)
-{
- int len;
-
#ifdef CONFIG_F2FS_FS_LZ4HC
- return lz4hc_compress_pages(cc);
+ else
+ len = LZ4_compress_HC(cc->rbuf, cc->cbuf->cdata, cc->rlen,
+ cc->clen, level, cc->private);
#endif
- len = LZ4_compress_default(cc->rbuf, cc->cbuf->cdata, cc->rlen,
- cc->clen, cc->private);
+ if (len < 0)
+ return len;
if (!len)
return -EAGAIN;