diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2008-12-05 19:03:24 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-01-06 11:53:54 -0500 |
commit | cab2d3c99165abbba2943f1b269003b17fd3b1cb (patch) | |
tree | 8e5fe08d1caf86564e56a1936f7e32af7eebd0e0 /fs/lockd | |
parent | 7e44d3bea21fbb9494930d1cd35ca92a9a4a3279 (diff) |
NSM: Encode the new "priv" cookie for NSMPROC_MON requests
Pass the new "priv" cookie to NSMPROC_MON's XDR encoder, instead of
creating the "priv" argument in the encoder at call time.
This patch should not cause a behavioral change: the contents of the
cookie remain the same for the time being.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/lockd')
-rw-r--r-- | fs/lockd/mon.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c index c8d18cd22b8a..4424b0a5a51f 100644 --- a/fs/lockd/mon.c +++ b/fs/lockd/mon.c | |||
@@ -31,7 +31,7 @@ enum { | |||
31 | }; | 31 | }; |
32 | 32 | ||
33 | struct nsm_args { | 33 | struct nsm_args { |
34 | __be32 addr; /* remote address */ | 34 | struct nsm_private *priv; |
35 | u32 prog; /* RPC callback info */ | 35 | u32 prog; /* RPC callback info */ |
36 | u32 vers; | 36 | u32 vers; |
37 | u32 proc; | 37 | u32 proc; |
@@ -101,7 +101,7 @@ nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res) | |||
101 | struct rpc_clnt *clnt; | 101 | struct rpc_clnt *clnt; |
102 | int status; | 102 | int status; |
103 | struct nsm_args args = { | 103 | struct nsm_args args = { |
104 | .addr = nsm_addr_in(nsm)->sin_addr.s_addr, | 104 | .priv = &nsm->sm_priv, |
105 | .prog = NLM_PROGRAM, | 105 | .prog = NLM_PROGRAM, |
106 | .vers = 3, | 106 | .vers = 3, |
107 | .proc = NLMPROC_NSM_NOTIFY, | 107 | .proc = NLMPROC_NSM_NOTIFY, |
@@ -407,9 +407,6 @@ static int encode_mon_id(struct xdr_stream *xdr, const struct nsm_args *argp) | |||
407 | * The "priv" argument may contain private information required | 407 | * The "priv" argument may contain private information required |
408 | * by the NSMPROC_MON call. This information will be supplied in the | 408 | * by the NSMPROC_MON call. This information will be supplied in the |
409 | * NLMPROC_SM_NOTIFY call. | 409 | * NLMPROC_SM_NOTIFY call. |
410 | * | ||
411 | * Linux provides the raw IP address of the monitored host, | ||
412 | * left in network byte order. | ||
413 | */ | 410 | */ |
414 | static int encode_priv(struct xdr_stream *xdr, const struct nsm_args *argp) | 411 | static int encode_priv(struct xdr_stream *xdr, const struct nsm_args *argp) |
415 | { | 412 | { |
@@ -418,10 +415,7 @@ static int encode_priv(struct xdr_stream *xdr, const struct nsm_args *argp) | |||
418 | p = xdr_reserve_space(xdr, SM_PRIV_SIZE); | 415 | p = xdr_reserve_space(xdr, SM_PRIV_SIZE); |
419 | if (unlikely(p == NULL)) | 416 | if (unlikely(p == NULL)) |
420 | return -EIO; | 417 | return -EIO; |
421 | *p++ = argp->addr; | 418 | xdr_encode_opaque_fixed(p, argp->priv->data, SM_PRIV_SIZE); |
422 | *p++ = 0; | ||
423 | *p++ = 0; | ||
424 | *p++ = 0; | ||
425 | return 0; | 419 | return 0; |
426 | } | 420 | } |
427 | 421 | ||