Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp573938imw; Fri, 15 Jul 2022 08:47:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sysLe3fOMRMxHchLBEsyuiIRmGxHdr3ymbhqRP6NPWylpLbg901rv8Qrm+P337/YXpdrUS X-Received: by 2002:a17:907:970d:b0:72b:3589:a22c with SMTP id jg13-20020a170907970d00b0072b3589a22cmr14617523ejc.621.1657900074071; Fri, 15 Jul 2022 08:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657900074; cv=none; d=google.com; s=arc-20160816; b=vLpe7UIVR1XOUufpkNT699BAX00MrqxKpMhCN0nmtga/hCcj2LcoNef3d38nb36nXC 53P2rlW4sQrgbg+nvcOpVaQdLpB0r3HJNx0Mo25zpIp4jTeiYP6m9C6efQNhTibC1+5U 5jUdXVoTj6MK/gEULlUqsQ8FshMtuyZcXg95nNzA2qmWszBctRoKSdOIjMrd7UEciMcT JELEevwb6/AnhlBJ4j08uDBG7N0JN7qU5eWE1np9T3KKY9NUsxMnHFIoYSveyaYOTGZl Pvp0kY7OGhdHPD2885s12sc9k7FTejxYupFlNxT1YfMAAnHLJg4x8T7uyMwatwJ7oCx9 QfMQ== 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=z1C4HP4lVOpvGkS1Ms8sqXxPt5DAs/4XNTVh7mr9jqk=; b=Uv7cRkaXvM/Wv4y9xfghzrhPiAGi1fdnfnU82ZtChTw3uOWDdL9wEmLqKJhSkcUYk+ /jw4V3NVG7Glmr/Nj6PxWpOLk+KGk2U4dBH0MlbwV9uppeofB9+EfpseOLUD8g2f29aH Oi/Ts3vlVpS+DRXAF5Z90L61xP+V38jkW6mPX93ET9PkLWvQv7+/kjho3LiI3lvY1OoP aqw39hiazBN5ZuimA2ZU/TpkRw8lg0kAudrzaut8ZG6bjxX8aP6bPA6ZUJjEHjL+iaLi mPnBF6YnG/U9Dl97aWjwIEC6uNLXkKBRfrbIgcueBR9m2mK2cWQm+xUguwhInLSe0MNb 2Qrg== 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 p22-20020a17090635d600b006fec3023067si5413983ejb.343.2022.07.15.08.47.29; Fri, 15 Jul 2022 08:47:54 -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 S235782AbiGOPm4 (ORCPT + 99 others); Fri, 15 Jul 2022 11:42:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234996AbiGOPm1 (ORCPT ); Fri, 15 Jul 2022 11:42:27 -0400 Received: from out199-12.us.a.mail.aliyun.com (out199-12.us.a.mail.aliyun.com [47.90.199.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 646B9528A7 for ; Fri, 15 Jul 2022 08:42:26 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;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_---0VJPnC6._1657899741; Received: from e18g06460.et15sqa.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VJPnC6._1657899741) by smtp.aliyun-inc.com; Fri, 15 Jul 2022 23:42:22 +0800 From: Gao Xiang To: linux-erofs@lists.ozlabs.org, Chao Yu Cc: LKML , Gao Xiang Subject: [PATCH v2 09/16] erofs: get rid of `enum z_erofs_page_type' Date: Fri, 15 Jul 2022 23:41:56 +0800 Message-Id: <20220715154203.48093-10-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.24.4 In-Reply-To: <20220715154203.48093-1-hsiangkao@linux.alibaba.com> References: <20220715154203.48093-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,SPF_HELO_NONE,SPF_PASS,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 2d5e2ed3e5f5..f2a513299d82 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) }; -/* (obsoleted) page type for online pages */ -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