Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1321442ybg; Wed, 29 Jul 2020 11:03:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpsOKyGEt6AnduF1hRnfun9QCcZC67QfF1IGuO908EcM88Jpyv5MmU5BukqNMXpKpTRhbc X-Received: by 2002:a17:906:8595:: with SMTP id v21mr32780773ejx.333.1596045839544; Wed, 29 Jul 2020 11:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596045839; cv=none; d=google.com; s=arc-20160816; b=q+xuKIAafa5Mv1/ctf3hQs0mcPGrmDYddZmRuB6wWI6SwbOm988KvZv5/PBP9Bp2IV rcEvM7xG409CmZQ3ZhNeXcetZSSvxbu026G60mVcLJnf9Qt7NUcnbV07/HKLW5f6qaZZ y5y4jah/DOcP+L3bvQO8YazJgvKoXqHFi0d1WMeE0rToeIRfID+JiJfJ7vcbb4WoDRze BeO6Sf2lJTQuBeaW+qkMc9T4MdMid826ArFYdg3mQS/z2jfyy61AJ1EtE/7ljpykt0eN 4Lia3lRyaf1IB7Ev/z/mWKxjAeZod6bgf+s4Xta1oOOA7ChIGRV1aBu05HNQd7Tc9HGc lewQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=yPxwBGHvqALkfsrQrrIYpsq7hoQPI6RVBDt+ux1gexE=; b=X79WPh45qwCNA5LCg6QQnfVqDZ4YywvoFKGNsmFVDZSDlGc0lkeyJvdwDjSFouoBGh f/R1qVpzLcshCenBXYaWjL3c25aofF29lJsmWDTgG7RJUsGJCuJ8hn8OGuu0hOkoB74N W9siN0lNA9eikug8myLcCpcfoKhvAXrVLSYy2bFCEv+NANI356DeAphRnKfu8/gLj8gw vLD5/WLGiAob2KgKS6brTF681xqMdJNQ4pBguUucWKZXF2na3yDXl3CrcqUR3KPeu6K0 mF+H2sIzvqKtLMn64mPvwlMDV7QWTSpEzspbSJUomYwq7tyqhKe4QHzPSE0uhhzuTwdM qx7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gXSzA+ic; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d13si1721261edp.312.2020.07.29.11.03.36; Wed, 29 Jul 2020 11:03:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gXSzA+ic; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726606AbgG2SDX (ORCPT + 99 others); Wed, 29 Jul 2020 14:03:23 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:36105 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726336AbgG2SDW (ORCPT ); Wed, 29 Jul 2020 14:03:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596045801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=yPxwBGHvqALkfsrQrrIYpsq7hoQPI6RVBDt+ux1gexE=; b=gXSzA+icinw85huwwXhH5wmcF2UHlzH/MTxoLCxAxxwNF4E3sL8FFHuB1+f1pHFYNcKL+d 6uv4mBAwR02aaokNScqP9nGdkHoOllwl+LtikzyI3JgX70QQD+FFaMOSENhWKwHAmw5xat FQFb6brK7H+ieBakSUnBpGVDiBFV744= Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-178-xT_nsobDNEGjE9sYtWEgrg-1; Wed, 29 Jul 2020 14:03:18 -0400 X-MC-Unique: xT_nsobDNEGjE9sYtWEgrg-1 Received: by mail-pf1-f198.google.com with SMTP id x2so9962284pfo.11 for ; Wed, 29 Jul 2020 11:03:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yPxwBGHvqALkfsrQrrIYpsq7hoQPI6RVBDt+ux1gexE=; b=teb8xMEEDTZ2pPhqasSQy+uArz038Ej03GVXzS++87WQIbbnRPskx80Y1En16uFO8b 5letRtjevrEt1HO256RUvltHEtffgQX/UWA3eHojeW/pZnyuvvyZipplGVXgGlO2SvwE g1W3htJ3yQghabdIggIl4k0sdMxQjdoDYiv/P/D681beUx2EVVfjdncTo8SC+4flc9MT yRmCElAuYE0nxUkJx7WCHNPFPzMqqCC3wKGOJdJw2lkrKYRGzXEvwbwd3pFweyCDe59/ op3P8ld4u3wXnupPd46HgbiTQ09ikLPmeIXV4Z8e5syXcqfSQOvcmfjNVduobmh0hqiZ b1XA== X-Gm-Message-State: AOAM530ciYZsp1RP9CjKzdNcVQE52WV0u7moru/38YCYEbHuJf+5aZgF kzOUkY9QIA04lB3BnjwAZnyp2sxRVormMhoISR7CzqvBSItQAbtaxw3pWcgEtX1XVOrQpgN7E2s Aw7attXm896RklVNk9ILlqSCq X-Received: by 2002:a17:902:368:: with SMTP id 95mr29689636pld.279.1596045797407; Wed, 29 Jul 2020 11:03:17 -0700 (PDT) X-Received: by 2002:a17:902:368:: with SMTP id 95mr29689623pld.279.1596045797161; Wed, 29 Jul 2020 11:03:17 -0700 (PDT) Received: from xiangao.remote.csb ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id np4sm2311140pjb.4.2020.07.29.11.03.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jul 2020 11:03:16 -0700 (PDT) From: Gao Xiang To: linux-erofs@lists.ozlabs.org, Chao Yu Cc: LKML , Chao Yu , Gao Xiang Subject: [PATCH] erofs: fold in used-once helper erofs_workgroup_unfreeze_final() Date: Thu, 30 Jul 2020 02:02:35 +0800 Message-Id: <20200729180235.25443-1-hsiangkao@redhat.com> X-Mailer: git-send-email 2.18.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's expected that erofs_workgroup_unfreeze_final() won't be used in other places. Let's fold it to simplify the code. Signed-off-by: Gao Xiang --- fs/erofs/utils.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/fs/erofs/utils.c b/fs/erofs/utils.c index 52d0be10f1aa..14485a621862 100644 --- a/fs/erofs/utils.c +++ b/fs/erofs/utils.c @@ -127,12 +127,6 @@ int erofs_workgroup_put(struct erofs_workgroup *grp) return count; } -static void erofs_workgroup_unfreeze_final(struct erofs_workgroup *grp) -{ - erofs_workgroup_unfreeze(grp, 0); - __erofs_workgroup_free(grp); -} - static bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi, struct erofs_workgroup *grp) { @@ -162,11 +156,9 @@ static bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi, */ DBG_BUGON(xa_erase(&sbi->managed_pslots, grp->index) != grp); - /* - * If managed cache is on, last refcount should indicate - * the related workstation. - */ - erofs_workgroup_unfreeze_final(grp); + /* last refcount should be connected with its managed pslot. */ + erofs_workgroup_unfreeze(grp, 0); + __erofs_workgroup_free(grp); return true; } -- 2.18.1