aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4xdr.c
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2011-07-13 11:04:21 -0400
committerJ. Bruce Fields <bfields@redhat.com>2011-07-15 18:58:47 -0400
commite1ca12dfb1be7fe8b82ca723a9b511f7d808bf81 (patch)
tree4d70be30b1bbd329d1edb036f9b974cce24f9b40 /fs/nfsd/nfs4xdr.c
parentebc63e531cc6a457595dd110b07ac530eae788c3 (diff)
NFSD: added FREE_STATEID operation
This operation is used by the client to tell the server to free a stateid. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 990181103214..ef9bd6f24fc0 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1246,6 +1246,19 @@ nfsd4_decode_destroy_session(struct nfsd4_compoundargs *argp,
1246} 1246}
1247 1247
1248static __be32 1248static __be32
1249nfsd4_decode_free_stateid(struct nfsd4_compoundargs *argp,
1250 struct nfsd4_free_stateid *free_stateid)
1251{
1252 DECODE_HEAD;
1253
1254 READ_BUF(sizeof(stateid_t));
1255 READ32(free_stateid->fr_stateid.si_generation);
1256 COPYMEM(&free_stateid->fr_stateid.si_opaque, sizeof(stateid_opaque_t));
1257
1258 DECODE_TAIL;
1259}
1260
1261static __be32
1249nfsd4_decode_sequence(struct nfsd4_compoundargs *argp, 1262nfsd4_decode_sequence(struct nfsd4_compoundargs *argp,
1250 struct nfsd4_sequence *seq) 1263 struct nfsd4_sequence *seq)
1251{ 1264{
@@ -1370,7 +1383,7 @@ static nfsd4_dec nfsd41_dec_ops[] = {
1370 [OP_EXCHANGE_ID] = (nfsd4_dec)nfsd4_decode_exchange_id, 1383 [OP_EXCHANGE_ID] = (nfsd4_dec)nfsd4_decode_exchange_id,
1371 [OP_CREATE_SESSION] = (nfsd4_dec)nfsd4_decode_create_session, 1384 [OP_CREATE_SESSION] = (nfsd4_dec)nfsd4_decode_create_session,
1372 [OP_DESTROY_SESSION] = (nfsd4_dec)nfsd4_decode_destroy_session, 1385 [OP_DESTROY_SESSION] = (nfsd4_dec)nfsd4_decode_destroy_session,
1373 [OP_FREE_STATEID] = (nfsd4_dec)nfsd4_decode_notsupp, 1386 [OP_FREE_STATEID] = (nfsd4_dec)nfsd4_decode_free_stateid,
1374 [OP_GET_DIR_DELEGATION] = (nfsd4_dec)nfsd4_decode_notsupp, 1387 [OP_GET_DIR_DELEGATION] = (nfsd4_dec)nfsd4_decode_notsupp,
1375 [OP_GETDEVICEINFO] = (nfsd4_dec)nfsd4_decode_notsupp, 1388 [OP_GETDEVICEINFO] = (nfsd4_dec)nfsd4_decode_notsupp,
1376 [OP_GETDEVICELIST] = (nfsd4_dec)nfsd4_decode_notsupp, 1389 [OP_GETDEVICELIST] = (nfsd4_dec)nfsd4_decode_notsupp,
@@ -3116,6 +3129,21 @@ nfsd4_encode_destroy_session(struct nfsd4_compoundres *resp, int nfserr,
3116} 3129}
3117 3130
3118static __be32 3131static __be32
3132nfsd4_encode_free_stateid(struct nfsd4_compoundres *resp, int nfserr,
3133 struct nfsd4_free_stateid *free_stateid)
3134{
3135 __be32 *p;
3136
3137 if (nfserr)
3138 return nfserr;
3139
3140 RESERVE_SPACE(4);
3141 WRITE32(nfserr);
3142 ADJUST_ARGS();
3143 return nfserr;
3144}
3145
3146static __be32
3119nfsd4_encode_sequence(struct nfsd4_compoundres *resp, int nfserr, 3147nfsd4_encode_sequence(struct nfsd4_compoundres *resp, int nfserr,
3120 struct nfsd4_sequence *seq) 3148 struct nfsd4_sequence *seq)
3121{ 3149{
@@ -3196,7 +3224,7 @@ static nfsd4_enc nfsd4_enc_ops[] = {
3196 [OP_EXCHANGE_ID] = (nfsd4_enc)nfsd4_encode_exchange_id, 3224 [OP_EXCHANGE_ID] = (nfsd4_enc)nfsd4_encode_exchange_id,
3197 [OP_CREATE_SESSION] = (nfsd4_enc)nfsd4_encode_create_session, 3225 [OP_CREATE_SESSION] = (nfsd4_enc)nfsd4_encode_create_session,
3198 [OP_DESTROY_SESSION] = (nfsd4_enc)nfsd4_encode_destroy_session, 3226 [OP_DESTROY_SESSION] = (nfsd4_enc)nfsd4_encode_destroy_session,
3199 [OP_FREE_STATEID] = (nfsd4_enc)nfsd4_encode_noop, 3227 [OP_FREE_STATEID] = (nfsd4_enc)nfsd4_encode_free_stateid,
3200 [OP_GET_DIR_DELEGATION] = (nfsd4_enc)nfsd4_encode_noop, 3228 [OP_GET_DIR_DELEGATION] = (nfsd4_enc)nfsd4_encode_noop,
3201 [OP_GETDEVICEINFO] = (nfsd4_enc)nfsd4_encode_noop, 3229 [OP_GETDEVICEINFO] = (nfsd4_enc)nfsd4_encode_noop,
3202 [OP_GETDEVICELIST] = (nfsd4_enc)nfsd4_encode_noop, 3230 [OP_GETDEVICELIST] = (nfsd4_enc)nfsd4_encode_noop,