Message ID | 20230330164948.29644-1-frank.li@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1270553vqo; Thu, 30 Mar 2023 09:52:12 -0700 (PDT) X-Google-Smtp-Source: AKy350YDi2dxFu18Verl21QfyLqhROAHzqxDRNW+tqBG2VKI96IePYlw+s67oikHUz2rmFLLJrH2 X-Received: by 2002:a62:7b91:0:b0:625:cc03:df33 with SMTP id w139-20020a627b91000000b00625cc03df33mr19484303pfc.31.1680195132497; Thu, 30 Mar 2023 09:52:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680195132; cv=pass; d=google.com; s=arc-20160816; b=aR436mdGNSiGobkWTR5vtVVA6wGp7t68stIShLOwHR1+XPj1gScuh/jmxougG0XBgR vjJ6/vjFclJfUOOzmoaYUaSATa9ZpQX4aJMpi4iAFBK8RB9wNFT4Nj2nzOdMVFWk6VM3 ZUYXQ5htxJhgI1OSUY4qEgnAAIAFUK3Y6dn/nyerKNewM7TqNjiVZDcDmSegLLA1Uz8x zWrZh+KGvmbOnTSPkrIS5zK4Yt0J60m0JpvmJjhAaqj+mwm1GyKs1HATvDds/AC5cMXt WksEJh5+1XG2KtuNmhIlaZ7Us17ty/kR+FZwXg0BInAyZv5xaaYcfBuIdYJzg2Kuxbj6 tMRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=u9jDTYwzuHpy0M7uPUlxv+bYEweovSShVKMF5+6WB5c=; b=ZXDRhp6JSbDS097AZu2Gx0yTY0o3DozfC6dVqA0y6oZ1MXpMQdeu3JgsSo7lNhpej9 LP8t1ueaetlza9WHQOHAbHlkvbb3NbRkqjrlPspNOtBAcP1tUEk6TBJX8u+j31MGGcbh 0zNb2ik67D5wSsvvaQdmBiZvmFy4xlp/m8wG2qnNsd66IiAz0ubiU+MISdE8fgGTncRV 7KVVUwgUnii8UPbmS4mKhuoZ/2J7a2v0LgbP20gUQaI6CVWd3OTyM6MFP/9luhNnscsk meyGeBt3loIRP325+2iEZaZzz4rZNeQM6+Xg9/6DZcELn3dUlI0Hwza7rcTEK672F+02 eT+A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=qFYWvjZC; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020aa79405000000b006280cd49409si236065pfo.21.2023.03.30.09.51.59; Thu, 30 Mar 2023 09:52:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=qFYWvjZC; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230152AbjC3QvC (ORCPT <rfc822;rua109.linux@gmail.com> + 99 others); Thu, 30 Mar 2023 12:51:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231773AbjC3Qur (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 30 Mar 2023 12:50:47 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2092.outbound.protection.outlook.com [40.107.117.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C6ABF76B for <linux-kernel@vger.kernel.org>; Thu, 30 Mar 2023 09:50:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G2V98v1xsp16JasHV9+HSBGKsfz8n2QnNG9Ji3M1PfDYLAufC4U0MU5Jon8RULtHeAjjhjVC7Tox2YBN+jilSSRVvv4gVdcD3qcLImMWT1lOfdgFXM7d6idVT8COM9vKOjaqnPJ0Dm8iJVhW3VwhD3RdpFFUe+yZ5yXdXkj2e8dc0ZFYmRF+jF/3rgpDkitJVxQwjEHoci0Xlw+XJX+/EIJ83l77ZqI0FqWFtbjQYjdKVvd0hbKY9ORGPUs3DM8Ajsjt5EMLMOYzTwXsdZnJPuw7BfIBOfqG6PwtZ6iOTZMvDNDkNEycrG4qq9Nc4Vk1bRuud/4QgCel4m1nt4m55A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u9jDTYwzuHpy0M7uPUlxv+bYEweovSShVKMF5+6WB5c=; b=R91tIAI1tAlUIDgMiEMj1bdSDSqvXOrSialqFyqNioMX2l/ETkplCUPcUcA8uk/qe0W9N3X/SJwWs4ZGG+eIVOnA261eP5BeyvNHQuqV53a3DH/rgYo/Ht1nZAA0G9k1AUAxsLW+2WpWi8Dp9tPxPyubMWp8CSjsawfgFcib/wdx/M5vLnSo+5n9poPVXuADGfGLa9J+A2U0xVtFAxRX0K6cIDro42e74nn0YBqJ5TkGxOLBWIuYTKAi+uruCwuBf+BBR4KyFFtfvyXfP4GDM4EKhjwkuYHSuY9XgXVKI8J0I18mXQr/V4sE1y0gIT7RNsdlOkvUBDeUePS4PHvVVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u9jDTYwzuHpy0M7uPUlxv+bYEweovSShVKMF5+6WB5c=; b=qFYWvjZC2qw9+DJUmRp7G0EXW+5lFF5bbwHWTZ23nb54XU0hswPEPIrc82ug3hNTIgPFfWfxN59vUWOs/PHeRDrPYkGltH1KTw9CX+0ngbkhFntR+Tzh59hJSjhcoGLjY2tyNvpv26i9eMqnAyWIg8UbfttyYScMWebYpKA83hK344Ikxi8Q5CO+tstIYzaqKRqeoWfSQsALPjiK9UKhF0IzbWXb6Egna0nTRMVwCFwx3faCXEyylvR8uk1rg5e1pVf1SbeJT74KOtg18uQMHlkCzBuIMexujrJ8rEq/zXYQqF1TelvmuzWb0eIQL80HNhLv4gym6XZgKc/PNESyFQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SG2PR06MB5335.apcprd06.prod.outlook.com (2603:1096:4:1d7::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.21; Thu, 30 Mar 2023 16:50:00 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::a3a1:af8e:be1e:437c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::a3a1:af8e:be1e:437c%6]) with mapi id 15.20.6222.033; Thu, 30 Mar 2023 16:50:00 +0000 From: Yangtao Li <frank.li@vivo.com> To: Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <chao@kernel.org> Cc: Yangtao Li <frank.li@vivo.com>, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH v2] f2fs: merge lz4hc_compress_pages() to lz4_compress_pages() Date: Fri, 31 Mar 2023 00:49:47 +0800 Message-Id: <20230330164948.29644-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0010.apcprd02.prod.outlook.com (2603:1096:4:194::15) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SG2PR06MB5335:EE_ X-MS-Office365-Filtering-Correlation-Id: facdf84c-cc94-4860-1c4e-08db313ecd09 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XvnGr8a7TJUl1gz2R2S+zln3mjJFF5GjgzXjNKJmImNnZAvga7kJyRdq7bOwlHGvmj0vN4NpOaJjzPUT1wVRogiGJ+Uvx3999xyclOAiNRYcmKou/sQZhjvfSwah43hpbHGKC0k2+yftmo6uhwyXejsGfwxwwaFbtDiroq7rtkPlg9vsHk0ltDtYEYj50f8GTIQ1FvtXft19rS87fXJn9TJdrSfpKz5r8WIrg8lKR7CNpM0nfZtxmoc/lJoQ8Y7ITeNipy3T/9FCaJj1DuFY4dh/oEzqSyVmM7iQa3FD8p3v7iNSey4wLLLRqiMYRJ/5hhhDNbPQJTRNco7v5Aws4bvoifN9h4YD6LrsuFMFoCz7LUVi5PM/Fnt6njipWm++t8OdhGIdoNrWmtuxpTktWmfBql4mCDkBglKS9qZXvjyaHL8M4cM9WsC9LIBGvEMR7mP4YETdAyxZPkaRa2JFWGTG9tUft3gqT1nlCIxNf5r65tkcC4boco9CkMbdGb/+aSicOuv/SsLyoudXBSW2ETCb9nS5THze9nFgAcO+gXVWkwD3o1jNv5UqYTyYCY01R86s+lBFZKAo0DKNSRGKP8KuZ1tf7mdzn+IhK7vX1P594RGps5esOKkqiDwHy95u X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(136003)(39860400002)(366004)(346002)(451199021)(8676002)(478600001)(86362001)(6666004)(8936002)(66556008)(66946007)(66476007)(4326008)(41300700001)(110136005)(316002)(26005)(38100700002)(38350700002)(1076003)(6506007)(36756003)(2616005)(83380400001)(6512007)(2906002)(5660300002)(6486002)(52116002)(186003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1lj/xoS429nSgmS5UNN5u8Tmbw9qR1Uxo02MC2zn+9bCHqsYBuydiAenJz8/boUqIbT+OF0/lp3WISjoHWLBc5lIqC/1aM23B35vikmDPNrSysr4qE1GH3uusp7GMa6W6Clus+qPgwCVERTWmsXkkOZ4kHgazWhNpY8figSItqQ37GqL9FR6KAkquzQ48v+jFTHhJY7G5R7uyQDI02c6dqyVMC8riGd0fWBK63aKAhH0ua09hPBMBn6XzwfZxu0/O++0JLakY4b0g3T5ZoGs0q5dtXkVq9GRdZv5EOpUZBvt4UijN8f8Z4CyBRzSLiPjcLyjwrnXXWvK7t2YuO9Jvn7pW89Lb787PRZirdwVT37sOgMKVXwaZdC3rFpMyY5BeQtgXju5hRIS7Kznvgo3W+kCq59gI2rF/rSSYlbBCYBpS5H8OPNgzhgqiK9v6OrANpPjGDzS7UANniS4HGOoZ1SwmJTztG1YpmX5NTBK3OnzRSssv4YIxVd7o7KuFF/FD/eMVdpnZK7uz4csyz4umlY9zYqmDRTxB9hATdzQTIaLPlIQt02zLjlc+ZzGQefbY3CE628jJUwNlvv4zzDbJalAxi6iF1C2xxC85tvSsDTWO3OLaBHArWbFMyYFAiWo8YM5ql+tSLUqKsiWWj5GpcP5wm4upMiVfC3ECZ7FFPJ5huB7kDj6F7hdRclZYq1P+EkrHC6zKn/QZfVNUAlrE5/ALl4b5Afhy8erenyrC1bqYrjv2mapUW0vluXYnKN030h6XYzrpZGDAwM6vTa0NRD+ET8qtklq2QDQt2JJ2oA58HugrLkZRrES/dmWi1bSCzxU7+YpsAVW5mrFf5D0RvFzNjfAU/Ctd9dGONgi+LluWYDN5UMG+2dhJ8eTWjyNXjfVBDzwgXC0er9vpv6HZMU4J4pPvcKmjtda94WGA3H3F4XJ4Cwfi963v/Gw3Uf4/jhSzPcpF2AeDCGt1P/iKMabUSlOhGoNklankD/JLhS2M/3MdZhBvRmrxqrAy5CNhXNyQSb0RKUFPyFi4H7m+r+sS4DFzBb8F5UGGEH6MoABiRAEZM40PWSX+PwesN7WwMsYqXYAT5AXCLT1+JlTmDaghEfAZ+nQP63RvmMDR6edh1wn8iFqKlIIzCERRUgb/cNlb2VZvzEaTtvudogBTy7Pgu/rk1YxgwKEDI+xJnRE8G6Ek2S/PViAFbaWg6z1p+zIsWCvj0Rv2msCOE42IO/c4iT5okVAkD/9eDsVnfZNUUWrN5+STMBuSqJRw2hhdxuuJ7tpvK9WorJJM/zTnh0Cyw0e1WGt6AMnsD6T023mkW28/lyEOWYNihyaNeLRDvEBg/MgyJ50uQeFMtK/GTpduZoXinWXz9POLjaXKzHvmWSHAv5DM68j7bfPo3ds50kv6VQIYewnIpS6kM+yV4uSBOEJnO8fPFfR9WgDrNlXhtEMmSQXPxMsGc74RL0LoJ59CRP5rqU+Eod25f/rIOeH+Jfu52IlqAOuHvL/HcVx0pszLlplxBZ6ITYA/Yslz2jciV1GZv1/RKBmQcZ1NCwA3HptbkUoxBIaEfmGiN6YmyQrOXQZ2/O1PDdLf7Lv X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: facdf84c-cc94-4860-1c4e-08db313ecd09 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2023 16:50:00.1774 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: V1wfjgZgMeuxPBGVi0hIv2bQYmt4XRRt3PkQPJaRtGZgBcx9k+xEjHENNPGXF5gkKZAFvSAcI4WUrGyLk0J1Og== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB5335 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761812291556325372?= X-GMAIL-MSGID: =?utf-8?q?1761812291556325372?= |
Series |
[v2] f2fs: merge lz4hc_compress_pages() to lz4_compress_pages()
|
|
Commit Message
李扬韬
March 30, 2023, 4:49 p.m. UTC
Remove unnecessary lz4hc_compress_pages().
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
v2:
-rebase
fs/f2fs/compress.c | 24 ++++--------------------
1 file changed, 4 insertions(+), 20 deletions(-)
Comments
On 2023/3/31 0:49, Yangtao Li wrote: > +#ifdef CONFIG_F2FS_FS_LZ4HC > + unsigned char level = F2FS_I(cc->inode)->i_compress_level; > > if (level) > len = LZ4_compress_HC(cc->rbuf, cc->cbuf->cdata, cc->rlen, > cc->clen, level, cc->private); > else [snip] > #endif [snip] > + len = LZ4_compress_default(cc->rbuf, cc->cbuf->cdata, cc->rlen, It's weired that whole else xxx; statement is split by #endif. What about? unsigned char level = 0; #if ... #endif if (!level) len = LZ4_compress_default() Thanks, > cc->clen, cc->private); > if (!len) > return -EAGAIN;
On 04/05, Chao Yu wrote: > On 2023/3/31 0:49, Yangtao Li wrote: > > +#ifdef CONFIG_F2FS_FS_LZ4HC > > + unsigned char level = F2FS_I(cc->inode)->i_compress_level; > > if (level) > > len = LZ4_compress_HC(cc->rbuf, cc->cbuf->cdata, cc->rlen, > > cc->clen, level, cc->private); > > else > > [snip] > > > #endif > > [snip] > > > + len = LZ4_compress_default(cc->rbuf, cc->cbuf->cdata, cc->rlen, > > It's weired that whole else xxx; statement is split by #endif. > > What about? > > unsigned char level = 0; > > #if > ... > #endif > if (!level) > len = LZ4_compress_default() I modified like this. --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -266,17 +266,19 @@ static void lz4_destroy_compress_ctx(struct compress_ctx *cc) static int lz4_compress_pages(struct compress_ctx *cc) { - int len; -#ifdef CONFIG_F2FS_FS_LZ4HC + int len = -EINVAL; unsigned char level = F2FS_I(cc->inode)->i_compress_level; - if (level) + if (!level) + len = LZ4_compress_default(cc->rbuf, cc->cbuf->cdata, cc->rlen, + cc->clen, cc->private); +#ifdef CONFIG_F2FS_FS_LZ4HC + else len = LZ4_compress_HC(cc->rbuf, cc->cbuf->cdata, cc->rlen, cc->clen, level, cc->private); - else #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; > > Thanks, > > > cc->clen, cc->private); > > if (!len) > > return -EAGAIN;
On 2023/4/6 0:13, Jaegeuk Kim wrote: > On 04/05, Chao Yu wrote: >> On 2023/3/31 0:49, Yangtao Li wrote: >>> +#ifdef CONFIG_F2FS_FS_LZ4HC >>> + unsigned char level = F2FS_I(cc->inode)->i_compress_level; >>> if (level) >>> len = LZ4_compress_HC(cc->rbuf, cc->cbuf->cdata, cc->rlen, >>> cc->clen, level, cc->private); >>> else >> >> [snip] >> >>> #endif >> >> [snip] >> >>> + len = LZ4_compress_default(cc->rbuf, cc->cbuf->cdata, cc->rlen, >> >> It's weired that whole else xxx; statement is split by #endif. >> >> What about? >> >> unsigned char level = 0; >> >> #if >> ... >> #endif >> if (!level) >> len = LZ4_compress_default() > > I modified like this. > > --- a/fs/f2fs/compress.c > +++ b/fs/f2fs/compress.c > @@ -266,17 +266,19 @@ static void lz4_destroy_compress_ctx(struct compress_ctx *cc) > > static int lz4_compress_pages(struct compress_ctx *cc) > { > - int len; > -#ifdef CONFIG_F2FS_FS_LZ4HC > + int len = -EINVAL; > unsigned char level = F2FS_I(cc->inode)->i_compress_level; > > - if (level) > + if (!level) > + len = LZ4_compress_default(cc->rbuf, cc->cbuf->cdata, cc->rlen, > + cc->clen, cc->private); > +#ifdef CONFIG_F2FS_FS_LZ4HC > + else > len = LZ4_compress_HC(cc->rbuf, cc->cbuf->cdata, cc->rlen, > cc->clen, level, cc->private); > - else > #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; > Better. Reviewed-by: Chao Yu <chao@kernel.org> Thanks,
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 3182e1506252..f8b15c932c97 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -264,34 +264,18 @@ 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) { - unsigned char level = F2FS_I(cc->inode)->i_compress_level; int len; +#ifdef CONFIG_F2FS_FS_LZ4HC + unsigned char level = F2FS_I(cc->inode)->i_compress_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, - 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); #endif - 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); if (!len) return -EAGAIN;