aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4xdr.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2010-10-04 23:12:59 -0400
committerJ. Bruce Fields <bfields@redhat.com>2011-01-11 15:04:09 -0500
commit1d1bc8f2074f0b728dfca2a3c16f2f5a3f298ffc (patch)
tree314aae91a98ab5358886a1d8517151f40816ec4c /fs/nfsd/nfs4xdr.c
parent4c6493785a1ea9c3b3522f199760a90a30e1626c (diff)
nfsd4: support BIND_CONN_TO_SESSION
Basic xdr and processing for BIND_CONN_TO_SESSION. This adds a connection to the list of connections associated with a session. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index ca3786905dec..4ff2c9e0b276 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -421,6 +421,21 @@ nfsd4_decode_access(struct nfsd4_compoundargs *argp, struct nfsd4_access *access
421 DECODE_TAIL; 421 DECODE_TAIL;
422} 422}
423 423
424static __be32 nfsd4_decode_bind_conn_to_session(struct nfsd4_compoundargs *argp, struct nfsd4_bind_conn_to_session *bcts)
425{
426 DECODE_HEAD;
427 u32 dummy;
428
429 READ_BUF(NFS4_MAX_SESSIONID_LEN + 8);
430 COPYMEM(bcts->sessionid.data, NFS4_MAX_SESSIONID_LEN);
431 READ32(bcts->dir);
432 /* XXX: Perhaps Tom Tucker could help us figure out how we
433 * should be using ctsa_use_conn_in_rdma_mode: */
434 READ32(dummy);
435
436 DECODE_TAIL;
437}
438
424static __be32 439static __be32
425nfsd4_decode_close(struct nfsd4_compoundargs *argp, struct nfsd4_close *close) 440nfsd4_decode_close(struct nfsd4_compoundargs *argp, struct nfsd4_close *close)
426{ 441{
@@ -1359,7 +1374,7 @@ static nfsd4_dec nfsd41_dec_ops[] = {
1359 1374
1360 /* new operations for NFSv4.1 */ 1375 /* new operations for NFSv4.1 */
1361 [OP_BACKCHANNEL_CTL] = (nfsd4_dec)nfsd4_decode_notsupp, 1376 [OP_BACKCHANNEL_CTL] = (nfsd4_dec)nfsd4_decode_notsupp,
1362 [OP_BIND_CONN_TO_SESSION]= (nfsd4_dec)nfsd4_decode_notsupp, 1377 [OP_BIND_CONN_TO_SESSION]= (nfsd4_dec)nfsd4_decode_bind_conn_to_session,
1363 [OP_EXCHANGE_ID] = (nfsd4_dec)nfsd4_decode_exchange_id, 1378 [OP_EXCHANGE_ID] = (nfsd4_dec)nfsd4_decode_exchange_id,
1364 [OP_CREATE_SESSION] = (nfsd4_dec)nfsd4_decode_create_session, 1379 [OP_CREATE_SESSION] = (nfsd4_dec)nfsd4_decode_create_session,
1365 [OP_DESTROY_SESSION] = (nfsd4_dec)nfsd4_decode_destroy_session, 1380 [OP_DESTROY_SESSION] = (nfsd4_dec)nfsd4_decode_destroy_session,
@@ -2383,6 +2398,21 @@ nfsd4_encode_access(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_
2383 return nfserr; 2398 return nfserr;
2384} 2399}
2385 2400
2401static __be32 nfsd4_encode_bind_conn_to_session(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_bind_conn_to_session *bcts)
2402{
2403 __be32 *p;
2404
2405 if (!nfserr) {
2406 RESERVE_SPACE(NFS4_MAX_SESSIONID_LEN + 8);
2407 WRITEMEM(bcts->sessionid.data, NFS4_MAX_SESSIONID_LEN);
2408 WRITE32(bcts->dir);
2409 /* XXX: ? */
2410 WRITE32(0);
2411 ADJUST_ARGS();
2412 }
2413 return nfserr;
2414}
2415
2386static __be32 2416static __be32
2387nfsd4_encode_close(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_close *close) 2417nfsd4_encode_close(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_close *close)
2388{ 2418{
@@ -3174,7 +3204,7 @@ static nfsd4_enc nfsd4_enc_ops[] = {
3174 3204
3175 /* NFSv4.1 operations */ 3205 /* NFSv4.1 operations */
3176 [OP_BACKCHANNEL_CTL] = (nfsd4_enc)nfsd4_encode_noop, 3206 [OP_BACKCHANNEL_CTL] = (nfsd4_enc)nfsd4_encode_noop,
3177 [OP_BIND_CONN_TO_SESSION] = (nfsd4_enc)nfsd4_encode_noop, 3207 [OP_BIND_CONN_TO_SESSION] = (nfsd4_enc)nfsd4_encode_bind_conn_to_session,
3178 [OP_EXCHANGE_ID] = (nfsd4_enc)nfsd4_encode_exchange_id, 3208 [OP_EXCHANGE_ID] = (nfsd4_enc)nfsd4_encode_exchange_id,
3179 [OP_CREATE_SESSION] = (nfsd4_enc)nfsd4_encode_create_session, 3209 [OP_CREATE_SESSION] = (nfsd4_enc)nfsd4_encode_create_session,
3180 [OP_DESTROY_SESSION] = (nfsd4_enc)nfsd4_encode_destroy_session, 3210 [OP_DESTROY_SESSION] = (nfsd4_enc)nfsd4_encode_destroy_session,