|
174 | 174 | decode_putfh_maxsz + \ |
175 | 175 | decode_deallocate_maxsz + \ |
176 | 176 | decode_getattr_maxsz) |
| 177 | +#define NFS4_enc_zero_range_sz (compound_encode_hdr_maxsz + \ |
| 178 | + encode_sequence_maxsz + \ |
| 179 | + encode_putfh_maxsz + \ |
| 180 | + encode_deallocate_maxsz + \ |
| 181 | + encode_allocate_maxsz + \ |
| 182 | + encode_getattr_maxsz) |
| 183 | +#define NFS4_dec_zero_range_sz (compound_decode_hdr_maxsz + \ |
| 184 | + decode_sequence_maxsz + \ |
| 185 | + decode_putfh_maxsz + \ |
| 186 | + decode_deallocate_maxsz + \ |
| 187 | + decode_allocate_maxsz + \ |
| 188 | + decode_getattr_maxsz) |
177 | 189 | #define NFS4_enc_read_plus_sz (compound_encode_hdr_maxsz + \ |
178 | 190 | encode_sequence_maxsz + \ |
179 | 191 | encode_putfh_maxsz + \ |
@@ -648,6 +660,27 @@ static void nfs4_xdr_enc_deallocate(struct rpc_rqst *req, |
648 | 660 | encode_nops(&hdr); |
649 | 661 | } |
650 | 662 |
|
| 663 | +/* |
| 664 | + * Encode ZERO_RANGE request |
| 665 | + */ |
| 666 | +static void nfs4_xdr_enc_zero_range(struct rpc_rqst *req, |
| 667 | + struct xdr_stream *xdr, |
| 668 | + const void *data) |
| 669 | +{ |
| 670 | + const struct nfs42_falloc_args *args = data; |
| 671 | + struct compound_hdr hdr = { |
| 672 | + .minorversion = nfs4_xdr_minorversion(&args->seq_args), |
| 673 | + }; |
| 674 | + |
| 675 | + encode_compound_hdr(xdr, req, &hdr); |
| 676 | + encode_sequence(xdr, &args->seq_args, &hdr); |
| 677 | + encode_putfh(xdr, args->falloc_fh, &hdr); |
| 678 | + encode_deallocate(xdr, args, &hdr); |
| 679 | + encode_allocate(xdr, args, &hdr); |
| 680 | + encode_getfattr(xdr, args->falloc_bitmask, &hdr); |
| 681 | + encode_nops(&hdr); |
| 682 | +} |
| 683 | + |
651 | 684 | /* |
652 | 685 | * Encode READ_PLUS request |
653 | 686 | */ |
@@ -1510,6 +1543,37 @@ static int nfs4_xdr_dec_deallocate(struct rpc_rqst *rqstp, |
1510 | 1543 | return status; |
1511 | 1544 | } |
1512 | 1545 |
|
| 1546 | +/* |
| 1547 | + * Decode ZERO_RANGE request |
| 1548 | + */ |
| 1549 | +static int nfs4_xdr_dec_zero_range(struct rpc_rqst *rqstp, |
| 1550 | + struct xdr_stream *xdr, |
| 1551 | + void *data) |
| 1552 | +{ |
| 1553 | + struct nfs42_falloc_res *res = data; |
| 1554 | + struct compound_hdr hdr; |
| 1555 | + int status; |
| 1556 | + |
| 1557 | + status = decode_compound_hdr(xdr, &hdr); |
| 1558 | + if (status) |
| 1559 | + goto out; |
| 1560 | + status = decode_sequence(xdr, &res->seq_res, rqstp); |
| 1561 | + if (status) |
| 1562 | + goto out; |
| 1563 | + status = decode_putfh(xdr); |
| 1564 | + if (status) |
| 1565 | + goto out; |
| 1566 | + status = decode_deallocate(xdr, res); |
| 1567 | + if (status) |
| 1568 | + goto out; |
| 1569 | + status = decode_allocate(xdr, res); |
| 1570 | + if (status) |
| 1571 | + goto out; |
| 1572 | + decode_getfattr(xdr, res->falloc_fattr, res->falloc_server); |
| 1573 | +out: |
| 1574 | + return status; |
| 1575 | +} |
| 1576 | + |
1513 | 1577 | /* |
1514 | 1578 | * Decode READ_PLUS request |
1515 | 1579 | */ |
|
0 commit comments