Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp747633imu; Tue, 20 Nov 2018 06:24:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xe0E2jGm/bAuleaCKtVfQGrBcn6IIXvUnnGcj/3f6tFmMCMYGvjoa8B73keND/1TFlLKyU X-Received: by 2002:a63:8b4b:: with SMTP id j72mr2098279pge.126.1542723872622; Tue, 20 Nov 2018 06:24:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542723872; cv=none; d=google.com; s=arc-20160816; b=BHcNmP2jHh1pz6BXGceTyFvDaiEUCPhqoa3OIiHxBYghMELh69nEGD8Fvkt1u/UT+o MFMnk/y2PU40U32/6XGuxC6vCfeXxLAGvzy4IL+NQCXw8hgGe2O++2xNHSPQZ4QJa50m xsF5GsOc9GfY3M9bT/e5Xh1vR7wuCEeA9OdLosjOPwvlnsNsWRNAIqmZ/AsBcLGzhpXV P94jXAT/49zYspwFnYqwfBwJE8MtyATMME21aRIoonZjKVgDZWdLTI/wu5T56fIh3iy9 I5X4uSeITqRytTEHq5IqmLsxr3qUu+8HS8BSyt/kjhssTRkekql2EFdnbDkGM/vHcyE0 ACAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=2k+ULfxIOITEARBVYohxlcj8eOkarr+2LoKoCg30oGE=; b=Whuv89LNdGIofjOQ8jwk7clKvd+5MsPqXmYOIzSBWPWk0TOn4sIfgvzosrdAC5q4nJ JcrtlhDXJIHqraRTB7Hvk6CqET6Ia36knLNIONzDur0I6/8RYyX4k3c7OTDN92Sv2htE DY16wMRtdllVu9L2SgHkBuPaqP+CD3YhsBzm8p5609VtmfrZBLcQsKCWGptoyheH6ktd i4oXTXxqdssJYg7gmh4U6i4Yq7IW/juj+IOSCAzBNxU/4Tt0yloemScFAqmIfqL/TwcF kbdQnMMF5Bgs6VxA0eI6/5ja2O1ncUC2GAxMTGCBSinCdnl8rWRQzCOxHN5K+RlGBKVd rBqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 89-v6si1290681plb.405.2018.11.20.06.24.17; Tue, 20 Nov 2018 06:24:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729812AbeKUAvr (ORCPT + 99 others); Tue, 20 Nov 2018 19:51:47 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:15129 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726916AbeKUAvr (ORCPT ); Tue, 20 Nov 2018 19:51:47 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 93AE49DE5D6E6; Tue, 20 Nov 2018 22:22:20 +0800 (CST) Received: from localhost.localdomain (10.175.124.28) by smtp.huawei.com (10.3.19.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 20 Nov 2018 22:22:14 +0800 From: Gao Xiang To: Greg Kroah-Hartman , CC: LKML , , "Chao Yu" , Miao Xie , , Gao Xiang Subject: [PATCH 10/10] staging: erofs: rename strange variable names in z_erofs_vle_frontend Date: Tue, 20 Nov 2018 22:34:25 +0800 Message-ID: <20181120143425.43637-11-gaoxiang25@huawei.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181120143425.43637-1-gaoxiang25@huawei.com> References: <20181120143425.43637-1-gaoxiang25@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Previously, 2 members called `initial' and `cachedzone_la' are used for applying caching policy (whether the workgroup is at either end), which are hard to understand, rename them to `backmost' and `headoffset'. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/unzip_vle.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/staging/erofs/unzip_vle.c b/drivers/staging/erofs/unzip_vle.c index 824d2c12c2f3..1ef178e7ac39 100644 --- a/drivers/staging/erofs/unzip_vle.c +++ b/drivers/staging/erofs/unzip_vle.c @@ -586,10 +586,9 @@ struct z_erofs_vle_frontend { z_erofs_vle_owned_workgrp_t owned_head; - bool initial; -#if (EROFS_FS_ZIP_CACHE_LVL >= 2) - erofs_off_t cachedzone_la; -#endif + /* used for applying cache strategy on the fly */ + bool backmost; + erofs_off_t headoffset; }; #define VLE_FRONTEND_INIT(__i) { \ @@ -600,7 +599,7 @@ struct z_erofs_vle_frontend { }, \ .builder = VLE_WORK_BUILDER_INIT(), \ .owned_head = Z_EROFS_VLE_WORKGRP_TAIL, \ - .initial = true, } + .backmost = true, } static int z_erofs_do_read_page(struct z_erofs_vle_frontend *fe, struct page *page, @@ -643,7 +642,7 @@ static int z_erofs_do_read_page(struct z_erofs_vle_frontend *fe, debugln("%s: [out-of-range] pos %llu", __func__, offset + cur); if (z_erofs_vle_work_iter_end(builder)) - fe->initial = false; + fe->backmost = false; map->m_la = offset + cur; map->m_llen = 0; @@ -669,8 +668,8 @@ static int z_erofs_do_read_page(struct z_erofs_vle_frontend *fe, erofs_blknr(map->m_pa), grp->compressed_pages, erofs_blknr(map->m_plen), /* compressed page caching selection strategy */ - fe->initial | (EROFS_FS_ZIP_CACHE_LVL >= 2 ? - map->m_la < fe->cachedzone_la : 0)); + fe->backmost | (EROFS_FS_ZIP_CACHE_LVL >= 2 ? + map->m_la < fe->headoffset : 0)); if (noio_outoforder && builder_is_followed(builder)) builder->role = Z_EROFS_VLE_WORK_PRIMARY; @@ -1316,9 +1315,8 @@ static int z_erofs_vle_normalaccess_readpage(struct file *file, trace_erofs_readpage(page, false); -#if (EROFS_FS_ZIP_CACHE_LVL >= 2) - f.cachedzone_la = (erofs_off_t)page->index << PAGE_SHIFT; -#endif + f.headoffset = (erofs_off_t)page->index << PAGE_SHIFT; + err = z_erofs_do_read_page(&f, page, &pagepool); (void)z_erofs_vle_work_iter_end(&f.builder); @@ -1354,9 +1352,8 @@ static int z_erofs_vle_normalaccess_readpages(struct file *filp, trace_erofs_readpages(mapping->host, lru_to_page(pages), nr_pages, false); -#if (EROFS_FS_ZIP_CACHE_LVL >= 2) - f.cachedzone_la = (erofs_off_t)lru_to_page(pages)->index << PAGE_SHIFT; -#endif + f.headoffset = (erofs_off_t)lru_to_page(pages)->index << PAGE_SHIFT; + for (; nr_pages; --nr_pages) { struct page *page = lru_to_page(pages); -- 2.14.4