aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-03-15 15:39:06 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-03-25 12:04:11 -0400
commitd9fc6619ca98943d56d2931ce9e4caa4039fd0f1 (patch)
tree982f2933a3d3b5c9d4c4cc463f33bcf77f83dede /fs/nfs/nfs4xdr.c
parent4a1c089345a0f00ad0229bf895bf0e94d101f059 (diff)
NFSv4.1: Add xdr support for CLAIM_FH and CLAIM_DELEG_CUR_FH opens
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 9d328777b4c1..650fa322b903 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -1459,6 +1459,23 @@ static inline void encode_claim_delegate_cur(struct xdr_stream *xdr, const struc
1459 encode_string(xdr, name->len, name->name); 1459 encode_string(xdr, name->len, name->name);
1460} 1460}
1461 1461
1462static inline void encode_claim_fh(struct xdr_stream *xdr)
1463{
1464 __be32 *p;
1465
1466 p = reserve_space(xdr, 4);
1467 *p = cpu_to_be32(NFS4_OPEN_CLAIM_FH);
1468}
1469
1470static inline void encode_claim_delegate_cur_fh(struct xdr_stream *xdr, const nfs4_stateid *stateid)
1471{
1472 __be32 *p;
1473
1474 p = reserve_space(xdr, 4);
1475 *p = cpu_to_be32(NFS4_OPEN_CLAIM_DELEG_CUR_FH);
1476 encode_nfs4_stateid(xdr, stateid);
1477}
1478
1462static void encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg, struct compound_hdr *hdr) 1479static void encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg, struct compound_hdr *hdr)
1463{ 1480{
1464 encode_op_hdr(xdr, OP_OPEN, decode_open_maxsz, hdr); 1481 encode_op_hdr(xdr, OP_OPEN, decode_open_maxsz, hdr);
@@ -1474,6 +1491,12 @@ static void encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg,
1474 case NFS4_OPEN_CLAIM_DELEGATE_CUR: 1491 case NFS4_OPEN_CLAIM_DELEGATE_CUR:
1475 encode_claim_delegate_cur(xdr, arg->name, &arg->u.delegation); 1492 encode_claim_delegate_cur(xdr, arg->name, &arg->u.delegation);
1476 break; 1493 break;
1494 case NFS4_OPEN_CLAIM_FH:
1495 encode_claim_fh(xdr);
1496 break;
1497 case NFS4_OPEN_CLAIM_DELEG_CUR_FH:
1498 encode_claim_delegate_cur_fh(xdr, &arg->u.delegation);
1499 break;
1477 default: 1500 default:
1478 BUG(); 1501 BUG();
1479 } 1502 }