Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4387339pxj; Tue, 8 Jun 2021 13:04:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMWkcy10ladufC68ExpaeBJlcCWYXLFQM7h4c9LQSaFZiCjkmKKsaPOTAs94gJQw2uwbPr X-Received: by 2002:a17:907:3e1a:: with SMTP id hp26mr25286154ejc.77.1623182643445; Tue, 08 Jun 2021 13:04:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623182643; cv=none; d=google.com; s=arc-20160816; b=wQkiWZW7Ip+vpyme2+1ql0m+9O7ZLcTAHQSK+aV0Osd+jqPNBSstO1LegsoYnOWkHj m8jkMiTtlbUSE7cR4T5IUoF4DdelW9eBM9FBlowqpQ1yEwMwtfMCHe8D/tla2uF2asO6 vYR7R8xiNuDzs9kfK0LZ9rGxjeIsn5ad2ispu7s516luZ+xH5YlX7EU3amy6xKjuIDeJ o8nx8PjwPYvsbCE6kFnN1XKsxR3vsyw34nTLp871LKncWDWHPj+LQyEH5Xn/K2JVnAW6 nhwMlMVcQN9P4kQlskTrbzw3JyzSWp4LIZZbloYobFTTlp5yeIMWM/GCOUGRy2RnmLkZ EOuw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gf/HTiMOF7lEE7p7o4BD7uDS+joARQgZSioVyNny/f4=; b=cLA0XqewANW+GfhtASQqUy4fb2JSBG3rZXtMcidcYm7SrzayxKnGRbLOpdMjmKtL5m XAcrkjv9KH8p3cU9Ck/JdFgi8XJsYcd8lhiQsnsNob5vPEPpNaBwMpFIfWDXL9dq0Jl/ 3ZVi0XKKkjG0LAvafdSAG3pMQPVPZ5zT/VWwqkKu2QgQxgi/UhxmfUhShcXuAfQl2yA0 jf4g8Xb20fFGy9vTBP41NCC/6G66bC2PvpvcmR4QZ6EkgVNh89aSQabucE8R08DDM7U1 uVnMhFtW85nUC6qDSECjKT7m4Q/J2LzPKKGXGN/itvuFAueuICLObyW/45SmYNLWYxcr AtHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DIAHWVj4; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oy3si500057ejb.550.2021.06.08.13.03.21; Tue, 08 Jun 2021 13:04:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=@gmail.com header.s=20161025 header.b=DIAHWVj4; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234339AbhFHUCg (ORCPT + 99 others); Tue, 8 Jun 2021 16:02:36 -0400 Received: from mail-qt1-f176.google.com ([209.85.160.176]:39508 "EHLO mail-qt1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234510AbhFHUCe (ORCPT ); Tue, 8 Jun 2021 16:02:34 -0400 Received: by mail-qt1-f176.google.com with SMTP id p21so4500704qtw.6 for ; Tue, 08 Jun 2021 13:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gf/HTiMOF7lEE7p7o4BD7uDS+joARQgZSioVyNny/f4=; b=DIAHWVj45dREIVdkhLKJO3c8T8LLmmcu49AWaKPb/wKliKe0tRkA2tAMMZY3nQOXok ikCZ9Mr/f6oUwHQFY0p/nUXR5AgKBZNklmZ0cvb1od5TKgJgSp57SenGKt4ursuGS9TI pgLlUX//QwwN6bjsLdhjgGtjGRYz59FflwPz8R19whAUNMSBJo4DnhO/1gKD+rgOUb3t 70Cu0vA7pjC2Hsj97JkSSYXKRHL13UXdnpV+PUTO7pPI/TihNJZyGDPEdOm8OGCxdFuq lXq2i+6xYOfgyEb1hc+ieTZqYws50RUnPAbX1Q9UOxvzMFOqyCwMvMysd1gigH0cmp+H NmKg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=gf/HTiMOF7lEE7p7o4BD7uDS+joARQgZSioVyNny/f4=; b=ftsr6ASZ9JksHf0k13V0q3Mc1abS8cb8x3onq4Fx47BSXAp6AsZcO1akcfuTeXIdiY sopE+AOboBDodb3hzELTemIUj3azfGjkk5ibeI7ZAVzYg6BzMjgwiI+l8ap2fF4BZQX/ mTvXVme1+Fm04sr5R+PmIDwwyA1+Zw/3du4Ci9YfG1/Rv1xZ+2hSTbmrP1dRPbZOWFpJ M/Qd0i6MCYZLwrfjnBwbdtstdUlYztWpkyU3UNgkHNSowVVaxnrIxRINippxf/7jNGhI A+AyUV3EQNmvV/Ga6LRHvSpR1GqV6Q6nizvVH77JrUyGcjIxWHpRj6nEFYGjmKcBpLjm bqWg== X-Gm-Message-State: AOAM531XgzjCLPMV5LvFF07DWD79+IIHWceBtxS6nHVIzgn0KucV5ylM QqyVvslZ6BtoygafM+U3Z48PPSAMyvg= X-Received: by 2002:a05:622a:356:: with SMTP id r22mr22656437qtw.363.1623182366695; Tue, 08 Jun 2021 12:59:26 -0700 (PDT) Received: from kolga-mac-1.vpn.netapp.com (nat-216-240-30-25.netapp.com. [216.240.30.25]) by smtp.gmail.com with ESMTPSA id j127sm12952765qke.90.2021.06.08.12.59.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jun 2021 12:59:26 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v10 01/13] sunrpc: Create a sunrpc directory under /sys/kernel/ Date: Tue, 8 Jun 2021 15:59:10 -0400 Message-Id: <20210608195922.88655-2-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20210608195922.88655-1-olga.kornievskaia@gmail.com> References: <20210608195922.88655-1-olga.kornievskaia@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Olga Kornievskaia This is where we'll put per-rpc_client related files Signed-off-by: Anna Schumaker Signed-off-by: Olga Kornievskaia --- net/sunrpc/Makefile | 2 +- net/sunrpc/sunrpc_syms.c | 8 ++++++++ net/sunrpc/sysfs.c | 20 ++++++++++++++++++++ net/sunrpc/sysfs.h | 11 +++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 net/sunrpc/sysfs.c create mode 100644 net/sunrpc/sysfs.h diff --git a/net/sunrpc/Makefile b/net/sunrpc/Makefile index 9488600451e8..1c8de397d6ad 100644 --- a/net/sunrpc/Makefile +++ b/net/sunrpc/Makefile @@ -12,7 +12,7 @@ sunrpc-y := clnt.o xprt.o socklib.o xprtsock.o sched.o \ auth.o auth_null.o auth_unix.o \ svc.o svcsock.o svcauth.o svcauth_unix.o \ addr.o rpcb_clnt.o timer.o xdr.o \ - sunrpc_syms.o cache.o rpc_pipe.o \ + sunrpc_syms.o cache.o rpc_pipe.o sysfs.o \ svc_xprt.o \ xprtmultipath.o sunrpc-$(CONFIG_SUNRPC_DEBUG) += debugfs.o diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c index 236fadc4a439..3b57efc692ec 100644 --- a/net/sunrpc/sunrpc_syms.c +++ b/net/sunrpc/sunrpc_syms.c @@ -24,6 +24,7 @@ #include #include "sunrpc.h" +#include "sysfs.h" #include "netns.h" unsigned int sunrpc_net_id; @@ -103,6 +104,10 @@ init_sunrpc(void) if (err) goto out4; + err = rpc_sysfs_init(); + if (err) + goto out5; + sunrpc_debugfs_init(); #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) rpc_register_sysctl(); @@ -111,6 +116,8 @@ init_sunrpc(void) init_socket_xprt(); /* clnt sock transport */ return 0; +out5: + unregister_rpc_pipefs(); out4: unregister_pernet_subsys(&sunrpc_net_ops); out3: @@ -124,6 +131,7 @@ init_sunrpc(void) static void __exit cleanup_sunrpc(void) { + rpc_sysfs_exit(); rpc_cleanup_clids(); rpcauth_remove_module(); cleanup_socket_xprt(); diff --git a/net/sunrpc/sysfs.c b/net/sunrpc/sysfs.c new file mode 100644 index 000000000000..27eda180ac5e --- /dev/null +++ b/net/sunrpc/sysfs.c @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2020 Anna Schumaker + */ +#include + +static struct kset *rpc_sunrpc_kset; + +int rpc_sysfs_init(void) +{ + rpc_sunrpc_kset = kset_create_and_add("sunrpc", NULL, kernel_kobj); + if (!rpc_sunrpc_kset) + return -ENOMEM; + return 0; +} + +void rpc_sysfs_exit(void) +{ + kset_unregister(rpc_sunrpc_kset); +} diff --git a/net/sunrpc/sysfs.h b/net/sunrpc/sysfs.h new file mode 100644 index 000000000000..f181c650aab8 --- /dev/null +++ b/net/sunrpc/sysfs.h @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2020 Anna Schumaker + */ +#ifndef __SUNRPC_SYSFS_H +#define __SUNRPC_SYSFS_H + +int rpc_sysfs_init(void); +void rpc_sysfs_exit(void); + +#endif -- 2.27.0