Commit 3094e557 authored by Yangtao Li's avatar Yangtao Li Committed by Jaegeuk Kim

f2fs: merge lz4hc_compress_pages() to lz4_compress_pages()

Remove unnecessary lz4hc_compress_pages().
Signed-off-by: default avatarYangtao Li <frank.li@vivo.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
[Jaegeuk Kim: clean up]
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 084e15ea
...@@ -264,35 +264,21 @@ static void lz4_destroy_compress_ctx(struct compress_ctx *cc) ...@@ -264,35 +264,21 @@ static void lz4_destroy_compress_ctx(struct compress_ctx *cc)
cc->private = NULL; cc->private = NULL;
} }
#ifdef CONFIG_F2FS_FS_LZ4HC static int lz4_compress_pages(struct compress_ctx *cc)
static int lz4hc_compress_pages(struct compress_ctx *cc)
{ {
int len = -EINVAL;
unsigned char level = F2FS_I(cc->inode)->i_compress_level; unsigned char level = F2FS_I(cc->inode)->i_compress_level;
int len;
if (level) if (!level)
len = LZ4_compress_HC(cc->rbuf, cc->cbuf->cdata, cc->rlen,
cc->clen, level, cc->private);
else
len = LZ4_compress_default(cc->rbuf, cc->cbuf->cdata, cc->rlen, len = LZ4_compress_default(cc->rbuf, cc->cbuf->cdata, cc->rlen,
cc->clen, cc->private); 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 #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 #endif
len = LZ4_compress_default(cc->rbuf, cc->cbuf->cdata, cc->rlen, if (len < 0)
cc->clen, cc->private); return len;
if (!len) if (!len)
return -EAGAIN; return -EAGAIN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment