summaryrefslogtreecommitdiff
path: root/fs/lockd/host.c
diff options
context:
space:
mode:
authorAndrey Ryabinin <aryabinin@virtuozzo.com>2015-10-07 14:39:55 +0300
committerJ. Bruce Fields <bfields@redhat.com>2015-10-23 15:57:27 -0400
commit0d0f4aab4e4d290138a4ae7f2ef8469e48c9a669 (patch)
tree7efb5dbfc6769b16a2f3415b5654efd83fd6d4db /fs/lockd/host.c
parent226453d8cfbd5f3bbdcef0d71e67186715bb811d (diff)
lockd: get rid of reference-counted NSM RPC clients
Currently we have reference-counted per-net NSM RPC client which created on the first monitor request and destroyed after the last unmonitor request. It's needed because RPC client need to know 'utsname()->nodename', but utsname() might be NULL when nsm_unmonitor() called. So instead of holding the rpc client we could just save nodename in struct nlm_host and pass it to the rpc_create(). Thus ther is no need in keeping rpc client until last unmonitor request. We could create separate RPC clients for each monitor/unmonitor requests. Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/lockd/host.c')
-rw-r--r--fs/lockd/host.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index b5f3c3ab0d5f..d716c9993a26 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -161,6 +161,7 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni,
host->h_nsmhandle = nsm;
host->h_addrbuf = nsm->sm_addrbuf;
host->net = ni->net;
+ strlcpy(host->nodename, utsname()->nodename, sizeof(host->nodename));
out:
return host;