Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3371004ybl; Mon, 20 Jan 2020 22:50:57 -0800 (PST) X-Google-Smtp-Source: APXvYqwUDL4JYy/IID4Fkj6rGRDNIJnV5OV6GjTfU+MF0Ps8vV4C/nBoOV+e7+JS4gn2oOHDBzq3 X-Received: by 2002:a9d:d0b:: with SMTP id 11mr2585012oti.287.1579589456905; Mon, 20 Jan 2020 22:50:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579589456; cv=none; d=google.com; s=arc-20160816; b=jaAecg9omgj6H4izcopBUweUjW77zo92LSwZOqZLSiD//3AFTLUf8egwsldyJaXv9i uP/5ZOhCPTvIubdZhYfb6OMU89s8gklVQszuTvQTnIE+vzUGyumwEvPbceh6/gRFceFp aI7JV7WTXnmpd/grpufg+RthlXWJ53oq8q0inoSGnDecjJeW2ur1n97vmaFMWBr+nEzY ug9Qr0x8PM4bm674w2gq8lK6iRzMWcj59ZP0hM1LrJW0EOhtvHobPIcfEUsw3hdSXkIv pkNVGhfUxdNGEbSopWmv1m+RnPylXiEp5odEkTQfg14Uftmsngf0Qea2PXDu4++j6e7P pKpA== 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=TAy0xqVyBtALWrUh/eb3e38KMzkYShiDE5rTjhj/7wY=; b=ZNeN+Kh5PI0CmSIxuOLTeha9WNas2lYe3KwF38Oh78SRP/0mpBuCYPJbUXothGdAN4 FPdkC3SQ/SdDb7LIPn5P8E0bQg7y+U6J9/MSEnTRzGruYbZMHiGDtiWpHCXkLFVptlRK 5xnGnfQpcpmR70UAXebLTLxNMBbHr4V9Sy6OQ13dKszllMhlL51pCHD7OdVQ3fDOV8yE xktEhefFN/Q9peTddnroFy1mYgmqqei1f8HqGvbvNFJIOdRkIMg7rhy8QGX7xO3HU0Fs q1+awFAlTHVVPiadcC9foUp87/AGrAWEh7TLHFMAsRkf7gelsmpYXmEBPOP8HAME1xMk 3/sg== 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 h7si22230503otk.86.2020.01.20.22.50.44; Mon, 20 Jan 2020 22:50:56 -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 S1727847AbgAUGss (ORCPT + 99 others); Tue, 21 Jan 2020 01:48:48 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:44424 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725789AbgAUGss (ORCPT ); Tue, 21 Jan 2020 01:48:48 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 3B466D0EA86C6B7B2D78; Tue, 21 Jan 2020 14:48:45 +0800 (CST) Received: from architecture4.huawei.com (10.160.196.180) by smtp.huawei.com (10.3.19.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 21 Jan 2020 14:48:35 +0800 From: Gao Xiang To: Chao Yu , CC: , Miao Xie , Gao Xiang Subject: [PATCH v2 1/2] erofs: fold in postsubmit_is_all_bypassed() Date: Tue, 21 Jan 2020 14:47:47 +0800 Message-ID: <20200121064747.138987-1-gaoxiang25@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200120085709.10320-1-hsiangkao@aol.com> References: <20200120085709.10320-1-hsiangkao@aol.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.160.196.180] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No need to introduce such separated helper since cache strategy compile configs were changed into runtime options instead in v5.4. No logic changes. Signed-off-by: Gao Xiang --- changes since v1: - fix a wrong condition force_fg -> *forge_fg by mistake. fs/erofs/zdata.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 4fedeb4496e4..f63a893fe886 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -1148,20 +1148,6 @@ static void move_to_bypass_jobqueue(struct z_erofs_pcluster *pcl, qtail[JQ_BYPASS] = &pcl->next; } -static bool postsubmit_is_all_bypassed(struct z_erofs_decompressqueue *q[], - unsigned int nr_bios, bool force_fg) -{ - /* - * although background is preferred, no one is pending for submission. - * don't issue workqueue for decompression but drop it directly instead. - */ - if (force_fg || nr_bios) - return false; - - kvfree(q[JQ_SUBMIT]); - return true; -} - static bool z_erofs_submit_queue(struct super_block *sb, z_erofs_next_pcluster_t owned_head, struct list_head *pagepool, @@ -1262,9 +1248,14 @@ static bool z_erofs_submit_queue(struct super_block *sb, if (bio) submit_bio(bio); - if (postsubmit_is_all_bypassed(q, nr_bios, *force_fg)) + /* + * although background is preferred, no one is pending for submission. + * don't issue workqueue for decompression but drop it directly instead. + */ + if (!*force_fg && !nr_bios) { + kvfree(q[JQ_SUBMIT]); return true; - + } z_erofs_decompress_kickoff(q[JQ_SUBMIT], *force_fg, nr_bios); return true; } -- 2.17.1