Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4861839iog; Wed, 22 Jun 2022 07:15:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t054sFRdd57x/mZuls2Kh/mlAnDmTH2q8H+2XpcjebEjtZ/RP/xcq6agid44odHBQcmQpJ X-Received: by 2002:a17:907:2ce3:b0:722:e1b0:68b7 with SMTP id hz3-20020a1709072ce300b00722e1b068b7mr3333413ejc.14.1655907303333; Wed, 22 Jun 2022 07:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655907303; cv=none; d=google.com; s=arc-20160816; b=FSmgrbxbyUoGisByvWO1l9pYlUBpEczsD+ZZ3ndF6tkhuADp+buzQb7qBlj15JVi/r jmWNPZksfL/+brmM9bklBjuzKwnkD4gx2bXtAvQkmubzcFiDtIvwCBVIwll+IpZwp9FC vU4bDIi8lF/GVtxfxkjfrp0U8xpeH4TRAdI7HFXz1teoHys9XXX6auoITvJsli+6t8EB krEmcfuAvUkjK5Lkfah5/fT9YaAvNFRZG34hnoe4Jxw7PLCdCUidQR8kJhBonvdc4xys mFse+QcNek8s+ScepNk78yXwYAUfS6yGanLkIZjNYamSC6NDRdzZWJmhNSJwmmTjsZPI jvkA== 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 :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject; bh=EE4sPkyqZgMntVMuJJ6FdX72SBXqNUzqx3riZcStDaI=; b=jqPwPs02YOZ3+4KvTjwklkny2L3XlvklmoO39m2qZSbPnbo0NOr/3CecRB3LsAjZut V9uN0z5e3MJA9dLq/hnwZhq4EThPMyeVEvfXNtyVdC4I+nhKzD3CVyUFm0uiqQLLaUyh 8QNrPdpcVkpdXJOgVMNqXHTGzrqhRsMR8qjULLcriarIdb66YYTlU2Je0UxDramzNqTc 9KuATY26wFmcL3rWg/djRTrKkSvR5xEm7Go599xY3I8pr0kIgvawPdl8uiS7qbMkuQcJ gQgqE1bR2aWxpUbFcCguo0/wHV/l4FoQFAL684h0c4c1FwMjkXqOITWVbUWfmwr1OwUe nsTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr34-20020a1709073fa200b00722e4fde192si5921276ejc.992.2022.06.22.07.14.37; Wed, 22 Jun 2022 07:15:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358186AbiFVOOH (ORCPT + 99 others); Wed, 22 Jun 2022 10:14:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358216AbiFVONb (ORCPT ); Wed, 22 Jun 2022 10:13:31 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F7DDB24; Wed, 22 Jun 2022 07:13:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id DF0F3CE206C; Wed, 22 Jun 2022 14:13:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D84BDC34114; Wed, 22 Jun 2022 14:13:26 +0000 (UTC) Subject: [PATCH RFC 06/30] NFSD: Refactor nfsd_file_gc() From: Chuck Lever To: linux-nfs@vger.kernel.org, netdev@vger.kernel.org Cc: david@fromorbit.com, tgraf@suug.ch, jlayton@redhat.com Date: Wed, 22 Jun 2022 10:13:25 -0400 Message-ID: <165590720591.75778.4222269976187194127.stgit@manet.1015granger.net> In-Reply-To: <165590626293.75778.9843437418112335153.stgit@manet.1015granger.net> References: <165590626293.75778.9843437418112335153.stgit@manet.1015granger.net> User-Agent: StGit/1.5.dev2+g9ce680a5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-nfs@vger.kernel.org Refactor nfsd_file_gc() to use the new list_lru helper. Signed-off-by: Chuck Lever --- fs/nfsd/filecache.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 763a08196dcd..930f1448173f 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -498,7 +498,11 @@ nfsd_file_lru_walk_list(struct shrink_control *sc) static void nfsd_file_gc(void) { - nfsd_file_lru_walk_list(NULL); + LIST_HEAD(dispose); + + list_lru_walk(&nfsd_file_lru, nfsd_file_lru_cb, + &dispose, LONG_MAX); + nfsd_file_gc_dispose_list(&dispose); } static void