summaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-03-14 14:25:46 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-03-19 18:01:01 -0400
commit850c95fd07b63704d06909c9a081c51272d32db1 (patch)
tree37cda66d133e442bfc54c97ed8d81016c3a33381 /fs/lockd
parent496951743100b2d2ccd8b268257e79425e489851 (diff)
downloadlinux-850c95fd07b63704d06909c9a081c51272d32db1.tar.gz
linux-850c95fd07b63704d06909c9a081c51272d32db1.tar.bz2
linux-850c95fd07b63704d06909c9a081c51272d32db1.zip
lockd: refactor SM_MON my_id argument encoder
Clean up: introduce a new XDR encoder specifically for the my_id argument of SM_MON requests. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/mon.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index 87bd4e4d65dd..06216d6715f7 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -183,6 +183,25 @@ static __be32 *xdr_encode_mon_name(__be32 *p, struct nsm_args *argp)
return xdr_encode_nsm_string(p, name);
}
+/*
+ * The "my_id" argument specifies the hostname and RPC procedure
+ * to be called when the status manager receives notification
+ * (via the SM_NOTIFY call) that the state of host "mon_name"
+ * has changed.
+ */
+static __be32 *xdr_encode_my_id(__be32 *p, struct nsm_args *argp)
+{
+ p = xdr_encode_nsm_string(p, utsname()->nodename);
+ if (!p)
+ return ERR_PTR(-EIO);
+
+ *p++ = htonl(argp->prog);
+ *p++ = htonl(argp->vers);
+ *p++ = htonl(argp->proc);
+
+ return p;
+}
+
static __be32 *
xdr_encode_common(struct rpc_rqst *rqstp, __be32 *p, struct nsm_args *argp)
{