Skip to content

Commit d97c058

Browse files
bcodding-rhTrond Myklebust
authored andcommitted
NFS: add a sysfs link to the lockd rpc_client
After lockd is started, add a symlink for lockd's rpc_client under NFS' superblock sysfs. Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent e13b549 commit d97c058

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

fs/lockd/clntlock.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ void nlmclnt_prepare_block(struct nlm_wait *block, struct nlm_host *host, struct
9393
block->b_status = nlm_lck_blocked;
9494
}
9595

96+
struct rpc_clnt *nlmclnt_rpc_clnt(struct nlm_host *host)
97+
{
98+
return host->h_rpcclnt;
99+
}
100+
EXPORT_SYMBOL_GPL(nlmclnt_rpc_clnt);
101+
96102
/*
97103
* Queue up a lock for blocking so that the GRANTED request can see it
98104
*/

fs/nfs/client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ static int nfs_start_lockd(struct nfs_server *server)
599599

600600
server->nlm_host = host;
601601
server->destroy = nfs_destroy_server;
602+
nfs_sysfs_link_rpc_client(server, nlmclnt_rpc_clnt(host), NULL);
602603
return 0;
603604
}
604605

include/linux/lockd/bind.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
/* Dummy declarations */
2121
struct svc_rqst;
2222
struct rpc_task;
23+
struct rpc_clnt;
2324

2425
/*
2526
* This is the set of functions for lockd->nfsd communication
@@ -56,6 +57,7 @@ struct nlmclnt_initdata {
5657

5758
extern struct nlm_host *nlmclnt_init(const struct nlmclnt_initdata *nlm_init);
5859
extern void nlmclnt_done(struct nlm_host *host);
60+
extern struct rpc_clnt *nlmclnt_rpc_clnt(struct nlm_host *host);
5961

6062
/*
6163
* NLM client operations provide a means to modify RPC processing of NLM

0 commit comments

Comments
 (0)