Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4206823iog; Tue, 28 Jun 2022 11:07:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sW/Ll677Im+cL4PzAql9elgsEQFONnpVoA85eyV06o5lXXtBV+QW+Q+cKONwXEEiYhzufz X-Received: by 2002:a05:6a02:310:b0:411:5e11:67b8 with SMTP id bn16-20020a056a02031000b004115e1167b8mr3235430pgb.164.1656439668946; Tue, 28 Jun 2022 11:07:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656439668; cv=none; d=google.com; s=arc-20160816; b=ngXqA/A4gMPjaP5MEbXMu7c25JqBbrvitb3pa6+INCYqRrQLef5D65OfZNGrjq/JdS H5hb5QzMM9nAkvarPavorMySXC7nO48Non2lBW8QaMp7izLlMfySrGksrtE0sQxialzL k+s249LCMrKGoDNYhbu3LySi+tKSnbMkuNHAJ4P4jFUa/6AHpKe41/1QzMLkLUobGCd9 VPYARALjhlDLyJn1O9A+7KqR2Ideb89ces7nuOpptPfRB13wd06qDruXQN1ducMqL2oI kiPXjNNrohJ+615umcgMY3nbfyle8hjuzDUJGXvqW5udBIy9zrVzTUZcrW1vvil4yVN0 9ffw== 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=0uF8Bbq6S8fJKoBK1K6ewRcISmdSREwhQ/KKlOuQvF4=; b=WBCNJI/pagP2Xm4zh/aZkJ7l4NERvyiSiI/v88QIU/oNWyfJ1pVlEdM/IHZZDWECq1 znIQObiGHL734JSzM4606jGs4hL51gJ/mubBNlx5L67+yU7z91P57aTXdckR1RYSz3IB iAGbQdvl2jyKbambOHAoDP0Lm1unW5q8OX0HuJIDmyeQFllDGuqq7QfjwPUR49CiLtyK Y/3yM3EabbMHextL8NE2ZoDkWCV6GxdIQ0NLS73KCKRggYNJ8Fb2kOcNYKMPjSz84FZ1 Dnhr7wsHHp/wr4tPrgiM/SB2/w9JRU/zn5MJhxzMlUpOaR68izLQD+hxxFgsTAL82YJ8 dShQ== 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 bu8-20020a056a00410800b0051bfad76f17si17116101pfb.100.2022.06.28.11.07.35; Tue, 28 Jun 2022 11:07:48 -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 S230231AbiF1SHI (ORCPT + 99 others); Tue, 28 Jun 2022 14:07:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233856AbiF1SHI (ORCPT ); Tue, 28 Jun 2022 14:07:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FD5B1DA79; Tue, 28 Jun 2022 11:07:06 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 156AD61ADB; Tue, 28 Jun 2022 18:07:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2111AC3411D; Tue, 28 Jun 2022 18:07:05 +0000 (UTC) Subject: [PATCH v2 12/31] NFSD: Hook up the filecache stat file From: Chuck Lever To: linux-nfs@vger.kernel.org, netdev@vger.kernel.org Cc: david@fromorbit.com, jlayton@redhat.com, tgraf@suug.ch Date: Tue, 28 Jun 2022 14:07:04 -0400 Message-ID: <165643962418.84360.9456943138614911583.stgit@manet.1015granger.net> In-Reply-To: <165643915086.84360.2809940286726976517.stgit@manet.1015granger.net> References: <165643915086.84360.2809940286726976517.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 There has always been the capability of exporting filecache metrics via /proc, but it was never hooked up. Let's surface these metrics to enable better observability of the filecache. Signed-off-by: Chuck Lever --- fs/nfsd/nfsctl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 0621c2faf242..631bf8422c0f 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -25,6 +25,7 @@ #include "state.h" #include "netns.h" #include "pnfs.h" +#include "filecache.h" /* * We have a single directory with several nodes in it. @@ -46,6 +47,7 @@ enum { NFSD_MaxBlkSize, NFSD_MaxConnections, NFSD_SupportedEnctypes, + NFSD_Filecache, /* * The below MUST come last. Otherwise we leave a hole in nfsd_files[] * with !CONFIG_NFSD_V4 and simple_fill_super() goes oops @@ -229,6 +231,13 @@ static const struct file_operations reply_cache_stats_operations = { .release = single_release, }; +static const struct file_operations filecache_ops = { + .open = nfsd_file_cache_stats_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + /*----------------------------------------------------------------------------*/ /* * payload - write methods @@ -1371,6 +1380,7 @@ static int nfsd_fill_super(struct super_block *sb, struct fs_context *fc) [NFSD_Ports] = {"portlist", &transaction_ops, S_IWUSR|S_IRUGO}, [NFSD_MaxBlkSize] = {"max_block_size", &transaction_ops, S_IWUSR|S_IRUGO}, [NFSD_MaxConnections] = {"max_connections", &transaction_ops, S_IWUSR|S_IRUGO}, + [NFSD_Filecache] = {"filecache", &filecache_ops, S_IRUGO}, #if defined(CONFIG_SUNRPC_GSS) || defined(CONFIG_SUNRPC_GSS_MODULE) [NFSD_SupportedEnctypes] = {"supported_krb5_enctypes", &supported_enctypes_ops, S_IRUGO}, #endif /* CONFIG_SUNRPC_GSS or CONFIG_SUNRPC_GSS_MODULE */