diff options
| author | J. Bruce Fields <bfields@citi.umich.edu> | 2009-02-02 17:30:51 -0500 |
|---|---|---|
| committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-03-18 17:30:49 -0400 |
| commit | 6c02eaa1d1e53b9b2cc27d0c6fff3e57da4b611f (patch) | |
| tree | af558f47858043d7c326c5b3d889c9447e65aaac | |
| parent | a4773c08f2872626cb923433284488fbe8acb0ae (diff) | |
nfsd4: use helper for copying delegation filehandle
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
| -rw-r--r-- | fs/nfsd/nfs4callback.c | 4 | ||||
| -rw-r--r-- | fs/nfsd/nfs4state.c | 4 | ||||
| -rw-r--r-- | include/linux/nfsd/state.h | 6 |
3 files changed, 5 insertions, 9 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index c464181b5994..c6804db33c17 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
| @@ -218,7 +218,7 @@ 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_cb_recall *cb_rec) |
| 219 | { | 219 | { |
| 220 | __be32 *p; | 220 | __be32 *p; |
| 221 | int len = cb_rec->cbr_fhlen; | 221 | int len = cb_rec->cbr_fh.fh_size; |
| 222 | 222 | ||
| 223 | RESERVE_SPACE(12+sizeof(cb_rec->cbr_stateid) + len); | 223 | RESERVE_SPACE(12+sizeof(cb_rec->cbr_stateid) + len); |
| 224 | WRITE32(OP_CB_RECALL); | 224 | WRITE32(OP_CB_RECALL); |
| @@ -226,7 +226,7 @@ encode_cb_recall(struct xdr_stream *xdr, struct nfs4_cb_recall *cb_rec) | |||
| 226 | WRITEMEM(&cb_rec->cbr_stateid.si_opaque, sizeof(stateid_opaque_t)); | 226 | WRITEMEM(&cb_rec->cbr_stateid.si_opaque, sizeof(stateid_opaque_t)); |
| 227 | WRITE32(cb_rec->cbr_trunc); | 227 | WRITE32(cb_rec->cbr_trunc); |
| 228 | WRITE32(len); | 228 | WRITE32(len); |
| 229 | WRITEMEM(cb_rec->cbr_fhval, len); | 229 | WRITEMEM(&cb_rec->cbr_fh.fh_base, len); |
| 230 | return 0; | 230 | return 0; |
| 231 | } | 231 | } |
| 232 | 232 | ||
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 41a3590ef2cc..7f616e928a57 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
| @@ -215,9 +215,7 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_stateid *stp, struct svc_f | |||
| 215 | dp->dl_stateid.si_stateownerid = current_delegid++; | 215 | dp->dl_stateid.si_stateownerid = current_delegid++; |
| 216 | dp->dl_stateid.si_fileid = 0; | 216 | dp->dl_stateid.si_fileid = 0; |
| 217 | dp->dl_stateid.si_generation = 0; | 217 | dp->dl_stateid.si_generation = 0; |
| 218 | dp->dl_fhlen = current_fh->fh_handle.fh_size; | 218 | fh_copy_shallow(&dp->dl_fh, ¤t_fh->fh_handle); |
| 219 | memcpy(dp->dl_fhval, ¤t_fh->fh_handle.fh_base, | ||
| 220 | current_fh->fh_handle.fh_size); | ||
| 221 | dp->dl_time = 0; | 219 | dp->dl_time = 0; |
| 222 | atomic_set(&dp->dl_count, 1); | 220 | atomic_set(&dp->dl_count, 1); |
| 223 | list_add(&dp->dl_perfile, &fp->fi_delegations); | 221 | list_add(&dp->dl_perfile, &fp->fi_delegations); |
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index b65b2a6274b0..1130d534bb63 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h | |||
| @@ -66,8 +66,7 @@ struct nfs4_cb_recall { | |||
| 66 | u32 cbr_ident; | 66 | u32 cbr_ident; |
| 67 | int cbr_trunc; | 67 | int cbr_trunc; |
| 68 | stateid_t cbr_stateid; | 68 | stateid_t cbr_stateid; |
| 69 | u32 cbr_fhlen; | 69 | struct knfsd_fh cbr_fh; |
| 70 | char cbr_fhval[NFS4_FHSIZE]; | ||
| 71 | struct nfs4_delegation *cbr_dp; | 70 | struct nfs4_delegation *cbr_dp; |
| 72 | }; | 71 | }; |
| 73 | 72 | ||
| @@ -86,8 +85,7 @@ struct nfs4_delegation { | |||
| 86 | }; | 85 | }; |
| 87 | 86 | ||
| 88 | #define dl_stateid dl_recall.cbr_stateid | 87 | #define dl_stateid dl_recall.cbr_stateid |
| 89 | #define dl_fhlen dl_recall.cbr_fhlen | 88 | #define dl_fh dl_recall.cbr_fh |
| 90 | #define dl_fhval dl_recall.cbr_fhval | ||
| 91 | 89 | ||
| 92 | /* client delegation callback info */ | 90 | /* client delegation callback info */ |
| 93 | struct nfs4_callback { | 91 | struct nfs4_callback { |
