diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2009-05-01 19:50:00 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-05-01 19:50:00 -0400 |
commit | b53d40c5070bffde1b2bcaf848412a50d8894794 (patch) | |
tree | 3f0e0f62997b437eb03678040393aa5e1fbfd315 /fs/nfsd/nfs4callback.c | |
parent | c237dc0303bcf6f4cc2e0efe4fe4e341c6f34dac (diff) |
nfsd4: eliminate struct nfs4_cb_recall
The nfs4_cb_recall struct is used only in nfs4_delegation, so its
pointer to the containing delegation is unnecessary--we could just use
container_of().
But there's no real reason to have this a separate struct at all--just
move these fields to nfs4_delegation.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfs4callback.c')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index ed860d7ddd19..2509305f6f53 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -215,18 +215,18 @@ encode_cb_compound_hdr(struct xdr_stream *xdr, struct nfs4_cb_compound_hdr *hdr) | |||
215 | } | 215 | } |
216 | 216 | ||
217 | static int | 217 | static int |
218 | encode_cb_recall(struct xdr_stream *xdr, struct nfs4_cb_recall *cb_rec) | 218 | encode_cb_recall(struct xdr_stream *xdr, struct nfs4_delegation *dp) |
219 | { | 219 | { |
220 | __be32 *p; | 220 | __be32 *p; |
221 | int len = cb_rec->cbr_fh.fh_size; | 221 | int len = dp->dl_fh.fh_size; |
222 | 222 | ||
223 | RESERVE_SPACE(12+sizeof(cb_rec->cbr_stateid) + len); | 223 | RESERVE_SPACE(12+sizeof(dp->dl_stateid) + len); |
224 | WRITE32(OP_CB_RECALL); | 224 | WRITE32(OP_CB_RECALL); |
225 | WRITE32(cb_rec->cbr_stateid.si_generation); | 225 | WRITE32(dp->dl_stateid.si_generation); |
226 | WRITEMEM(&cb_rec->cbr_stateid.si_opaque, sizeof(stateid_opaque_t)); | 226 | WRITEMEM(&dp->dl_stateid.si_opaque, sizeof(stateid_opaque_t)); |
227 | WRITE32(cb_rec->cbr_trunc); | 227 | WRITE32(dp->dl_trunc); |
228 | WRITE32(len); | 228 | WRITE32(len); |
229 | WRITEMEM(&cb_rec->cbr_fh.fh_base, len); | 229 | WRITEMEM(&dp->dl_fh.fh_base, len); |
230 | return 0; | 230 | return 0; |
231 | } | 231 | } |
232 | 232 | ||
@@ -241,11 +241,11 @@ nfs4_xdr_enc_cb_null(struct rpc_rqst *req, __be32 *p) | |||
241 | } | 241 | } |
242 | 242 | ||
243 | static int | 243 | static int |
244 | nfs4_xdr_enc_cb_recall(struct rpc_rqst *req, __be32 *p, struct nfs4_cb_recall *args) | 244 | nfs4_xdr_enc_cb_recall(struct rpc_rqst *req, __be32 *p, struct nfs4_delegation *args) |
245 | { | 245 | { |
246 | struct xdr_stream xdr; | 246 | struct xdr_stream xdr; |
247 | struct nfs4_cb_compound_hdr hdr = { | 247 | struct nfs4_cb_compound_hdr hdr = { |
248 | .ident = args->cbr_ident, | 248 | .ident = args->dl_ident, |
249 | .nops = 1, | 249 | .nops = 1, |
250 | }; | 250 | }; |
251 | 251 | ||
@@ -502,17 +502,15 @@ nfsd4_cb_recall(struct nfs4_delegation *dp) | |||
502 | { | 502 | { |
503 | struct nfs4_client *clp = dp->dl_client; | 503 | struct nfs4_client *clp = dp->dl_client; |
504 | struct rpc_clnt *clnt = clp->cl_cb_conn.cb_client; | 504 | struct rpc_clnt *clnt = clp->cl_cb_conn.cb_client; |
505 | struct nfs4_cb_recall *cbr = &dp->dl_recall; | ||
506 | struct rpc_message msg = { | 505 | struct rpc_message msg = { |
507 | .rpc_proc = &nfs4_cb_procedures[NFSPROC4_CLNT_CB_RECALL], | 506 | .rpc_proc = &nfs4_cb_procedures[NFSPROC4_CLNT_CB_RECALL], |
508 | .rpc_argp = cbr, | 507 | .rpc_argp = dp, |
509 | .rpc_cred = clp->cl_cb_conn.cb_cred | 508 | .rpc_cred = clp->cl_cb_conn.cb_cred |
510 | }; | 509 | }; |
511 | int retries = 1; | 510 | int retries = 1; |
512 | int status = 0; | 511 | int status = 0; |
513 | 512 | ||
514 | cbr->cbr_trunc = 0; /* XXX need to implement truncate optimization */ | 513 | dp->dl_trunc = 0; /* XXX need to implement truncate optimization */ |
515 | cbr->cbr_dp = dp; | ||
516 | 514 | ||
517 | status = rpc_call_sync(clnt, &msg, RPC_TASK_SOFT); | 515 | status = rpc_call_sync(clnt, &msg, RPC_TASK_SOFT); |
518 | while (retries--) { | 516 | while (retries--) { |