Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp773836imw; Fri, 8 Jul 2022 11:25:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tCgOsTDghrr+upPWIXkm9i/njbt4bm7WjL0IhzWs6hQOboujp/Zcm7ObmlfGKBX6Z1jfgK X-Received: by 2002:a17:90a:6741:b0:1ef:7f62:6cd1 with SMTP id c1-20020a17090a674100b001ef7f626cd1mr1221525pjm.89.1657304747128; Fri, 08 Jul 2022 11:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657304747; cv=none; d=google.com; s=arc-20160816; b=y/MwE7u5q/ezs1NnsdhAKkFweth7MwZqsEHQJBxa2vnA8FE6AsLQ9EhIb72zQGYWrK i8ykDv6bzW1GM/z8C7i0Cw08t2b1yP+SZLKXjFAGQwEsEhlGaZRPE6Ujix6Me/HVz5CI 9g61vu1lv0oqAAsDoU2BK46yUVfKVNZSukGdaayJ+8RYPMUypGE1tx/aV+M+VBbWCeBA DjAFdzwnI/31RJayVAFxWQUgWtS41l+/Blr0gdX0meQR+IuajAZJ9DWAY/108VqJ/KvH M9EyINr1sdbok4ev4W0tsxfDKKNR58Hn80FpYxmEoqYWi33H5WIDiKJhVsv5uBdg3EET oSrQ== 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=+WEFxczYnU9WRp/Eyjyw6TrxmiN00CWFvIbcbCiGVB8=; b=pPTXeoWFv66rV8vc79yxH+/SgXRyIYO76J8lzK7H0IoLC7UZoE5ozzhFOeFKzlihSW esJBb8dB58sYpiaxERI4DY6Dzu1hgDyC1QRUUkPpTjF0jLgpNa5LER/Jpm9aRn1Y5aY0 lBlZ+glwGMm5jJqW/2HCRDscCFc75BRAg7u9xb9iGW67etnjzTbhN8+SNyIGjg4GTiCJ 9TAyrFxQLhkiiLClRev6Rq4PRMJgz/eH0V7mKDXQYqr4GSWCVd6VE4XuEtFu9bfCe+mG QuewFVTVX2AJHNlGasVQ7xm5YSPDKpk+UQGF1t8X5biCYuoAldnyr4+eIwWAlzpG8AYq B8lw== 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 j11-20020a170902da8b00b0016c281934b7si2411792plx.110.2022.07.08.11.25.35; Fri, 08 Jul 2022 11:25:47 -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 S239445AbiGHSZI (ORCPT + 99 others); Fri, 8 Jul 2022 14:25:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239456AbiGHSZD (ORCPT ); Fri, 8 Jul 2022 14:25:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24CCA823B6; Fri, 8 Jul 2022 11:25:02 -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 ams.source.kernel.org (Postfix) with ESMTPS id BD29DB82922; Fri, 8 Jul 2022 18:25:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25CA9C341C0; Fri, 8 Jul 2022 18:24:59 +0000 (UTC) Subject: [PATCH v3 12/32] 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: Fri, 08 Jul 2022 14:24:58 -0400 Message-ID: <165730469820.28142.10369457240055089259.stgit@klimt.1015granger.net> In-Reply-To: <165730437087.28142.6731645688073512500.stgit@klimt.1015granger.net> References: <165730437087.28142.6731645688073512500.stgit@klimt.1015granger.net> User-Agent: StGit/1.5.dev3+g9561319 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 66c352bf61b1..ecc08cf97a86 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 @@ -1370,6 +1379,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 */