Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp566361imw; Thu, 14 Jul 2022 06:50:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vCdfkLvAXiDAZ2WanE0QhiDf6jIrmBkCNtjhhZLuCjfwQQB9DOVv5Wclmxo5glbRxTVDc1 X-Received: by 2002:a65:6a48:0:b0:412:a3c3:48e0 with SMTP id o8-20020a656a48000000b00412a3c348e0mr7534693pgu.382.1657806616337; Thu, 14 Jul 2022 06:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657806616; cv=none; d=google.com; s=arc-20160816; b=yvOptoQvaIKPpdL0uwRPC1VLba/N7pWvvl/Vd0i8dsJFzm4z/GHLMmf3+sY55o5XJs YV7WdlMVUN9zfANMBX9ie6Or/XCUwKbts4G+umZIBt+i51uINnb8YBo2bkl+kdpiob9N PjKmCObWoj2xh5G5utOTZVMK/vf7P+U8NZtEwKXKCB3X8qPrleGumobRdu7L7JEpfZdX IjifiVbXCx2+fS3zaI8aGQyErTGmU0jR67BmZu1NvD4vDrQPzJPKfitopWoLnXMNSvvk yv5mU6rRgv4gL1+KqN1qVoI6gScF4ImNT1FctL0VvLAYJBu1s+na3XOV6lITKdEYtdbB Z20g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=usdlA80jF7rHqxphDd4cm3TOg+cutGo2xuDD7UpY/sE=; b=rWHXHQuwtxuIBP/WN1Yd90cpGuFSvoFpcwTpC9GonVZPMTUSLhWeM4it84f+YYAQu0 qabJUPKSaOrbhpglg0lRSP2CX0tBPeii6K4sXHxhnozxzIOiVvLqXKkvp2I14NPXDuZQ +ffuwHvO8FySn7tgp4vr1I9eNqPd0EaBoEcudoNY+xUDZQ65RlF9vJyUfiOuC6iZQWxJ GTkPxdScf+RhcWq8ewM+FAf88CW5BlaHSecRKqe97o9775sdx+z0DZ5boHbdmWjLN6CM Ty4/QIXqE2c0J3iec8uryOTPFEmX0IVzfCWadWtHpqy3lTKICwmXkBPFLp4hOPba2S4h pIXQ== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x9-20020a17090a6b4900b001f0c7936843si320078pjl.69.2022.07.14.06.50.03; Thu, 14 Jul 2022 06:50:16 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239528AbiGNNVq (ORCPT + 99 others); Thu, 14 Jul 2022 09:21:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239657AbiGNNVQ (ORCPT ); Thu, 14 Jul 2022 09:21:16 -0400 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24D1F5A2DB for ; Thu, 14 Jul 2022 06:21:14 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R601e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0VJJkPLG_1657804870; Received: from e18g06460.et15sqa.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VJJkPLG_1657804870) by smtp.aliyun-inc.com; Thu, 14 Jul 2022 21:21:12 +0800 From: Gao Xiang To: linux-erofs@lists.ozlabs.org, Chao Yu Cc: LKML , Gao Xiang Subject: [PATCH 09/16] erofs: get rid of `enum z_erofs_page_type' Date: Thu, 14 Jul 2022 21:20:44 +0800 Message-Id: <20220714132051.46012-10-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.24.4 In-Reply-To: <20220714132051.46012-1-hsiangkao@linux.alibaba.com> References: <20220714132051.46012-1-hsiangkao@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org Remove it since pagevec[] is no longer used. Signed-off-by: Gao Xiang --- fs/erofs/zdata.c | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 9065e160d6a6..cdfb2706e4ae 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -27,17 +27,6 @@ static struct z_erofs_pcluster_slab pcluster_pool[] __read_mostly = { _PCLP(Z_EROFS_PCLUSTER_MAX_PAGES) }; -/* page type in pagevec for decompress subsystem */ -enum z_erofs_page_type { - /* including Z_EROFS_VLE_PAGE_TAIL_EXCLUSIVE */ - Z_EROFS_PAGE_TYPE_EXCLUSIVE, - - Z_EROFS_VLE_PAGE_TYPE_TAIL_SHARED, - - Z_EROFS_VLE_PAGE_TYPE_HEAD, - Z_EROFS_VLE_PAGE_TYPE_MAX -}; - struct z_erofs_bvec_iter { struct page *bvpage; struct z_erofs_bvset *bvset; @@ -429,7 +418,6 @@ int erofs_try_to_free_cached_page(struct page *page) return ret; } -/* page_type must be Z_EROFS_PAGE_TYPE_EXCLUSIVE */ static bool z_erofs_try_inplace_io(struct z_erofs_decompress_frontend *fe, struct z_erofs_bvec *bvec) { @@ -447,13 +435,11 @@ static bool z_erofs_try_inplace_io(struct z_erofs_decompress_frontend *fe, /* callers must be with pcluster lock held */ static int z_erofs_attach_page(struct z_erofs_decompress_frontend *fe, - struct z_erofs_bvec *bvec, - enum z_erofs_page_type type) + struct z_erofs_bvec *bvec, bool exclusive) { int ret; - if (fe->mode >= COLLECT_PRIMARY && - type == Z_EROFS_PAGE_TYPE_EXCLUSIVE) { + if (fe->mode >= COLLECT_PRIMARY && exclusive) { /* give priority for inplaceio to use file pages first */ if (z_erofs_try_inplace_io(fe, bvec)) return 0; @@ -718,10 +704,9 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe, struct erofs_sb_info *const sbi = EROFS_I_SB(inode); struct erofs_map_blocks *const map = &fe->map; const loff_t offset = page_offset(page); - bool tight = true; + bool tight = true, exclusive; enum z_erofs_cache_alloctype cache_strategy; - enum z_erofs_page_type page_type; unsigned int cur, end, spiltted, index; int err = 0; @@ -798,12 +783,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe, goto next_part; } - /* let's derive page type */ - page_type = cur ? Z_EROFS_VLE_PAGE_TYPE_HEAD : - (!spiltted ? Z_EROFS_PAGE_TYPE_EXCLUSIVE : - (tight ? Z_EROFS_PAGE_TYPE_EXCLUSIVE : - Z_EROFS_VLE_PAGE_TYPE_TAIL_SHARED)); - + exclusive = (!cur && (!spiltted || tight)); if (cur) tight &= (fe->mode >= COLLECT_PRIMARY_FOLLOWED); @@ -812,7 +792,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe, .page = page, .offset = offset - map->m_la, .end = end, - }), page_type); + }), exclusive); /* should allocate an additional short-lived page for bvset */ if (err == -EAGAIN && !fe->candidate_bvpage) { fe->candidate_bvpage = alloc_page(GFP_NOFS | __GFP_NOFAIL); -- 2.24.4