public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Aloni <dan@kernelim.com>
To: linux-nfs@vger.kernel.org, Anna Schumaker <anna.schumaker@netapp.com>
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
Subject: [PATCH v1 1/8] sunrpc: rename 'net' to 'client'
Date: Mon, 15 Feb 2021 19:39:55 +0200	[thread overview]
Message-ID: <20210215174002.2376333-2-dan@kernelim.com> (raw)
In-Reply-To: <20210215174002.2376333-1-dan@kernelim.com>

This is in preparation to adding a second directory to keep track
of each transport.

Signed-off-by: Dan Aloni <dan@kernelim.com>
---
 net/sunrpc/clnt.c  |  8 ++++----
 net/sunrpc/sysfs.c | 22 +++++++++++-----------
 net/sunrpc/sysfs.h |  4 ++--
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 02905eae5c0a..0a4811be01cd 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -301,7 +301,7 @@ static int rpc_client_register(struct rpc_clnt *clnt,
 	int err;
 
 	rpc_clnt_debugfs_register(clnt);
-	rpc_netns_sysfs_setup(clnt, net);
+	rpc_netns_client_sysfs_setup(clnt, net);
 
 	pipefs_sb = rpc_get_sb_net(net);
 	if (pipefs_sb) {
@@ -329,7 +329,7 @@ static int rpc_client_register(struct rpc_clnt *clnt,
 out:
 	if (pipefs_sb)
 		rpc_put_sb_net(net);
-	rpc_netns_sysfs_destroy(clnt);
+	rpc_netns_client_sysfs_destroy(clnt);
 	rpc_clnt_debugfs_unregister(clnt);
 	return err;
 }
@@ -736,7 +736,7 @@ int rpc_switch_client_transport(struct rpc_clnt *clnt,
 
 	rpc_unregister_client(clnt);
 	__rpc_clnt_remove_pipedir(clnt);
-	rpc_netns_sysfs_destroy(clnt);
+	rpc_netns_client_sysfs_destroy(clnt);
 	rpc_clnt_debugfs_unregister(clnt);
 
 	/*
@@ -883,7 +883,7 @@ static void rpc_free_client_work(struct work_struct *work)
 	 * so they cannot be called in rpciod, so they are handled separately
 	 * here.
 	 */
-	rpc_netns_sysfs_destroy(clnt);
+	rpc_netns_client_sysfs_destroy(clnt);
 	rpc_clnt_debugfs_unregister(clnt);
 	rpc_free_clid(clnt);
 	rpc_clnt_remove_pipedir(clnt);
diff --git a/net/sunrpc/sysfs.c b/net/sunrpc/sysfs.c
index 8b01b4df64ee..3fe814795ed9 100644
--- a/net/sunrpc/sysfs.c
+++ b/net/sunrpc/sysfs.c
@@ -9,7 +9,7 @@
 #include "sysfs.h"
 
 struct kobject *rpc_client_kobj;
-static struct kset *rpc_client_kset;
+static struct kset *rpc_sunrpc_kset;
 
 static void rpc_netns_object_release(struct kobject *kobj)
 {
@@ -45,13 +45,13 @@ static struct kobject *rpc_netns_object_alloc(const char *name,
 
 int rpc_sysfs_init(void)
 {
-	rpc_client_kset = kset_create_and_add("sunrpc", NULL, kernel_kobj);
-	if (!rpc_client_kset)
+	rpc_sunrpc_kset = kset_create_and_add("sunrpc", NULL, kernel_kobj);
+	if (!rpc_sunrpc_kset)
 		return -ENOMEM;
-	rpc_client_kobj = rpc_netns_object_alloc("net", rpc_client_kset, NULL);
+	rpc_client_kobj = rpc_netns_object_alloc("client", rpc_sunrpc_kset, NULL);
 	if (!rpc_client_kobj) {
-		kset_unregister(rpc_client_kset);
-		rpc_client_kset = NULL;
+		kset_unregister(rpc_sunrpc_kset);
+		rpc_sunrpc_kset = NULL;
 		return -ENOMEM;
 	}
 	return 0;
@@ -119,18 +119,18 @@ static struct kobj_type rpc_netns_client_type = {
 void rpc_sysfs_exit(void)
 {
 	kobject_put(rpc_client_kobj);
-	kset_unregister(rpc_client_kset);
+	kset_unregister(rpc_sunrpc_kset);
 }
 
 static struct rpc_netns_client *rpc_netns_client_alloc(struct kobject *parent,
-						struct net *net, int clid)
+						       struct net *net, int clid)
 {
 	struct rpc_netns_client *p;
 
 	p = kzalloc(sizeof(*p), GFP_KERNEL);
 	if (p) {
 		p->net = net;
-		p->kobject.kset = rpc_client_kset;
+		p->kobject.kset = rpc_sunrpc_kset;
 		if (kobject_init_and_add(&p->kobject, &rpc_netns_client_type,
 					parent, "%d", clid) == 0)
 			return p;
@@ -139,7 +139,7 @@ static struct rpc_netns_client *rpc_netns_client_alloc(struct kobject *parent,
 	return NULL;
 }
 
-void rpc_netns_sysfs_setup(struct rpc_clnt *clnt, struct net *net)
+void rpc_netns_client_sysfs_setup(struct rpc_clnt *clnt, struct net *net)
 {
 	struct rpc_netns_client *rpc_client;
 	struct rpc_xprt *xprt = rcu_dereference(clnt->cl_xprt);
@@ -155,7 +155,7 @@ void rpc_netns_sysfs_setup(struct rpc_clnt *clnt, struct net *net)
 	}
 }
 
-void rpc_netns_sysfs_destroy(struct rpc_clnt *clnt)
+void rpc_netns_client_sysfs_destroy(struct rpc_clnt *clnt)
 {
 	struct rpc_netns_client *rpc_client = clnt->cl_sysfs;
 
diff --git a/net/sunrpc/sysfs.h b/net/sunrpc/sysfs.h
index 137a12c87954..ab75c3cc91b6 100644
--- a/net/sunrpc/sysfs.h
+++ b/net/sunrpc/sysfs.h
@@ -16,7 +16,7 @@ extern struct kobject *rpc_client_kobj;
 extern int rpc_sysfs_init(void);
 extern void rpc_sysfs_exit(void);
 
-void rpc_netns_sysfs_setup(struct rpc_clnt *clnt, struct net *net);
-void rpc_netns_sysfs_destroy(struct rpc_clnt *clnt);
+void rpc_netns_client_sysfs_setup(struct rpc_clnt *clnt, struct net *net);
+void rpc_netns_client_sysfs_destroy(struct rpc_clnt *clnt);
 
 #endif
-- 
2.26.2


  reply	other threads:[~2021-02-15 17:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15 17:39 [PATCH v1 0/8] sysfs files for multipath transport control Dan Aloni
2021-02-15 17:39 ` Dan Aloni [this message]
2021-02-16 21:24   ` [PATCH v1 1/8] sunrpc: rename 'net' to 'client' Anna Schumaker
2021-02-17 18:58     ` Dan Aloni
2021-02-15 17:39 ` [PATCH v1 2/8] sunrpc: add xprt id Dan Aloni
2021-02-15 17:39 ` [PATCH v1 3/8] sunrpc: add a directory per sunrpc xprt Dan Aloni
2021-02-16 21:46   ` Anna Schumaker
2021-02-17 19:01     ` Dan Aloni
2021-02-15 17:39 ` [PATCH v1 4/8] sunrpc: have client directory a symlink to the root transport Dan Aloni
2021-02-15 17:39 ` [PATCH v1 5/8] sunrpc: add IDs to multipath Dan Aloni
2021-02-15 17:40 ` [PATCH v1 6/8] sunrpc: add multipath directory and symlink from client Dan Aloni
2021-02-15 17:40 ` [PATCH v1 7/8] sunrpc: change rpc_clnt_add_xprt() to rpc_add_xprt() Dan Aloni
2021-02-15 17:40 ` [PATCH v1 8/8] sunrpc: introduce an 'add' node to 'multipath' sysfs directory Dan Aloni
2021-03-02  3:56 ` [PATCH v1 0/8] sysfs files for multipath transport control Olga Kornievskaia
2021-03-04 11:58   ` Dan Aloni
2021-03-04 18:39     ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210215174002.2376333-2-dan@kernelim.com \
    --to=dan@kernelim.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox