All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Coddington <bcodding@redhat.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 5/9] NFS: add a sysfs link to the lockd rpc_client
Date: Fri, 21 Apr 2023 13:18:35 -0400	[thread overview]
Message-ID: <e2d9155b4bbf300805ab4927cd66b87e7f8c77c9.1682097420.git.bcodding@redhat.com> (raw)
In-Reply-To: <cover.1682097420.git.bcodding@redhat.com>

After lockd is started, add a symlink for lockd's rpc_client under
NFS' superblock sysfs.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
---
 fs/lockd/clntlock.c        | 6 ++++++
 fs/nfs/client.c            | 1 +
 include/linux/lockd/bind.h | 2 ++
 3 files changed, 9 insertions(+)

diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index a5bb3f721a9d..0340e10b5715 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -94,6 +94,12 @@ void nlmclnt_done(struct nlm_host *host)
 }
 EXPORT_SYMBOL_GPL(nlmclnt_done);
 
+struct rpc_clnt *nlmclnt_rpc_clnt(struct nlm_host *host)
+{
+	return host->h_rpcclnt;
+}
+EXPORT_SYMBOL_GPL(nlmclnt_rpc_clnt);
+
 /*
  * Queue up a lock for blocking so that the GRANTED request can see it
  */
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index de275f1fde92..eede8c28a56b 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -592,6 +592,7 @@ static int nfs_start_lockd(struct nfs_server *server)
 
 	server->nlm_host = host;
 	server->destroy = nfs_destroy_server;
+	nfs_sysfs_link_rpc_client(server, nlmclnt_rpc_clnt(host), NULL);
 	return 0;
 }
 
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h
index 3bc9f7410e21..c53c81242e72 100644
--- a/include/linux/lockd/bind.h
+++ b/include/linux/lockd/bind.h
@@ -20,6 +20,7 @@
 /* Dummy declarations */
 struct svc_rqst;
 struct rpc_task;
+struct rpc_clnt;
 
 /*
  * This is the set of functions for lockd->nfsd communication
@@ -56,6 +57,7 @@ struct nlmclnt_initdata {
 
 extern struct nlm_host *nlmclnt_init(const struct nlmclnt_initdata *nlm_init);
 extern void	nlmclnt_done(struct nlm_host *host);
+extern struct rpc_clnt *nlmclnt_rpc_clnt(struct nlm_host *host);
 
 /*
  * NLM client operations provide a means to modify RPC processing of NLM
-- 
2.39.2


  parent reply	other threads:[~2023-04-21 17:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21 17:18 [PATCH 0/9 RFC v3] NFS sysfs scaffolding Benjamin Coddington
2023-04-21 17:18 ` [PATCH 1/9] NFS: rename nfs_client_kset to nfs_kset Benjamin Coddington
2023-04-21 17:18 ` [PATCH 2/9] NFS: rename nfs_client_kobj to nfs_net_kobj Benjamin Coddington
2023-04-21 17:18 ` [PATCH 3/9] NFS: add superblock sysfs entries Benjamin Coddington
2023-04-21 17:18 ` [PATCH 4/9] NFS: Add sysfs links to sunrpc clients for nfs_clients Benjamin Coddington
2023-04-21 17:18 ` Benjamin Coddington [this message]
2023-04-21 17:18 ` [PATCH 6/9] NFS: add a sysfs link to the acl rpc_client Benjamin Coddington
2023-04-21 17:18 ` [PATCH 7/9] NFS: add sysfs shutdown knob Benjamin Coddington
2023-04-21 17:18 ` [PATCH 8/9] NFS: Cancel all existing RPC tasks when shutdown Benjamin Coddington
2023-04-21 17:18 ` [PATCH 9/9] NFSv4: Clean up some shutdown loops Benjamin Coddington
  -- strict thread matches above, loose matches on Subject: below --
2023-04-21 17:08 [PATCH 0/9 RFC v2] NFS sysfs scaffolding Benjamin Coddington
2023-04-21 17:08 ` [PATCH 5/9] NFS: add a sysfs link to the lockd rpc_client Benjamin Coddington

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=e2d9155b4bbf300805ab4927cd66b87e7f8c77c9.1682097420.git.bcodding@redhat.com \
    --to=bcodding@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.