Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp525602pxb; Tue, 2 Feb 2021 10:47:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyk+7g2K52/ele0OqDAwYIY5bBfRGgFcMTvJ9Gad8bPFgk9GSLKulwu4nOfh+ymLMI6G6q+ X-Received: by 2002:a17:906:33db:: with SMTP id w27mr2548370eja.43.1612291671942; Tue, 02 Feb 2021 10:47:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612291671; cv=none; d=google.com; s=arc-20160816; b=UWME2EAImY21lzKX8hC56M1fazvIEJzQn1ZuJFY++6ZN+bK77u2+N9f4ljeIhyMqC4 EimubdqoP6cGx+btRMXseAHURRtN4MGtp/gV5iSDNAaSB69Iv1a2Q8DNCYpbvaSrICyi unZoBQZPxygpJOKRQICNEMwAY0jyIyBCIrEg1Idk254FTqVgozctcvYriVKHP0PBDqqt i60iRFm0pgG+jcUekI1DvUMlSD78TH+wGVZxqGg9HvfQ6+wWt3lsqplK8ws2BRcVm8yJ DaUV9h7jvfxWv5wgaeMHzsMnbsI2dxqQRx+mh6NPZeSzzJ3QQ1N6/IWiRvQsTv/vugsz dMNA== 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:sender :dkim-signature; bh=oQawKngObyoorCuyVqhiiQ0rHFSjPC2r0xk/zqMkP9U=; b=V6QI7ocpr4eFFscITukpTghEl+7B3qlIl+n8mfHV+v3WqzUMzRX7BB3k+fqpSLNbWl 15ilF6IU6fP7Po4JgsuQ/MzFtBfZeBMRR/zTtgO8iamILwOQf7+M5yV4BEWWLrWSw4fK 6p6T9MQr8JLtoc99ZjBIZxhJZzB/Wu0TxrwxiEQ482GiKtr+Vx9wBRBKIKwnjBdzwyxp jOEpaculwiHWJ+72mxzbDxLb3LJKW5kPkYobRGoMCTHnCNXV6jd/WbcmodBKIHlEtGKa ah7spweLgyh8dyLBM+gGsLXSHiYl9eQpMUhI/QQ+fTz8sDD8P3pkVkpv2BG1QeqogSzt aTuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XZbs40kq; 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 s21si12612977edd.135.2021.02.02.10.47.27; Tue, 02 Feb 2021 10:47:51 -0800 (PST) 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=XZbs40kq; 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 S238880AbhBBSo6 (ORCPT + 99 others); Tue, 2 Feb 2021 13:44:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238719AbhBBSn3 (ORCPT ); Tue, 2 Feb 2021 13:43:29 -0500 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA541C061788 for ; Tue, 2 Feb 2021 10:42:48 -0800 (PST) Received: by mail-qt1-x836.google.com with SMTP id r20so12132670qtm.3 for ; Tue, 02 Feb 2021 10:42:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oQawKngObyoorCuyVqhiiQ0rHFSjPC2r0xk/zqMkP9U=; b=XZbs40kqCynL+FUvW4arogKxhjUU9ML/It0ttCXGHqr9i/6cfG3Aug/c7yO2FGkxQB yoH5PLjm8BibZKNxETVaElp5b84qPVlsgirUSdfGJCY3Lymao5s0efdY+UKcZD284DlH 3a+QPon+W4iSqmcBbeM6BYaDU+IfBlgBBbqTlcxi1JaZwKUrX+nON9q5bvD3jJZ1E72S Q/xBJyAudp6CfORFYOwRusr3Gum7AEfCuMP7TWsrCvm3c1Mh/vnbJbm/oqv6J06COFKq JVHFjvV2kVFfgAuWhjO3YlnCJtVim1zWtcfPVO/T3PsHOkOwBarD6iC+q7iX81OLYkpg YBLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=oQawKngObyoorCuyVqhiiQ0rHFSjPC2r0xk/zqMkP9U=; b=q9cwDbkwfBCvtpFu/6wIqW0Mv49LTfgUsu3gln6XQ08QnzSlBl0M5Tqi6VKeAu4Bxh 7Ol86uTTpvEhe35RaXPufVRQ6QVmTHO6EB3EiJqoHaFLDbfCu4ddfVo+PuqpZ3zucau+ tq2YyP8IhjH2LyGN5LaujDFiPs23sc9pdoVl3cG/5BjhNm1j7d8PKIGkJUxjhWRCMsE7 e0olM6DOHOwwvQTyYpJoKuWJNK1uIgkIA4MIwy56NQiqs8jKn26VFsPxzuWCW0Sxs+Bp xNxEE0jdoEc8Wf6z7GE03pYgMdMXlPP+VrZrRVx3FkqAqzPQa/ZqJbkGWPSJOdDHedDT x6sA== X-Gm-Message-State: AOAM533CnX0wcwKslpnWLohuOMZik3rhdu36eYEwNuXocn3q9a/b4lIO x6ibOiQh7CpZikLHEg9In3wkxQ+/s7V39g== X-Received: by 2002:aed:3484:: with SMTP id x4mr20166047qtd.283.1612291367801; Tue, 02 Feb 2021 10:42:47 -0800 (PST) Received: from gouda.nowheycreamery.com (c-68-32-74-190.hsd1.mi.comcast.net. [68.32.74.190]) by smtp.gmail.com with ESMTPSA id k4sm7415906qtq.13.2021.02.02.10.42.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 10:42:47 -0800 (PST) Sender: Anna Schumaker From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: linux-nfs@vger.kernel.org Cc: Anna.Schumaker@Netapp.com Subject: [PATCH v2 1/5] sunrpc: Create a sunrpc directory under /sys/kernel/ Date: Tue, 2 Feb 2021 13:42:40 -0500 Message-Id: <20210202184244.288898-2-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210202184244.288898-1-Anna.Schumaker@Netapp.com> References: <20210202184244.288898-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Anna Schumaker This is where we'll put per-rpc_client related files Signed-off-by: Anna Schumaker --- v2: Move directory from /sys/net/sunrpc/ to /sys/kernel/sunrpc/ --- net/sunrpc/Makefile | 2 +- net/sunrpc/sunrpc_syms.c | 8 ++++++++ net/sunrpc/sysfs.c | 20 ++++++++++++++++++++ net/sunrpc/sysfs.h | 13 +++++++++++++ 4 files changed, 42 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..fbb8db50eb29 --- /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_client_kset; + +int rpc_sysfs_init(void) +{ + rpc_client_kset = kset_create_and_add("sunrpc", NULL, kernel_kobj); + if (!rpc_client_kset) + return -ENOMEM; + return 0; +} + +void rpc_sysfs_exit(void) +{ + kset_unregister(rpc_client_kset); +} diff --git a/net/sunrpc/sysfs.h b/net/sunrpc/sysfs.h new file mode 100644 index 000000000000..93c3cd220506 --- /dev/null +++ b/net/sunrpc/sysfs.h @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2020 Anna Schumaker + */ +#ifndef __SUNRPC_SYSFS_H +#define __SUNRPC_SYSFS_H + +extern struct kobject *rpc_client_kobj; + +extern int rpc_sysfs_init(void); +extern void rpc_sysfs_exit(void); + +#endif -- 2.29.2