Commit 6308bc98 authored by Olga Kornievskaia's avatar Olga Kornievskaia Committed by J. Bruce Fields

NFSD OFFLOAD_STATUS xdr

Signed-off-by: default avatarOlga Kornievskaia <kolga@netapp.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 9eb190fc
...@@ -1144,6 +1144,13 @@ nfsd4_fallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -1144,6 +1144,13 @@ nfsd4_fallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
fput(file); fput(file);
return status; return status;
} }
static __be32
nfsd4_offload_status(struct svc_rqst *rqstp,
struct nfsd4_compound_state *cstate,
union nfsd4_op_u *u)
{
return nfserr_notsupp;
}
static __be32 static __be32
nfsd4_allocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, nfsd4_allocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
...@@ -2047,6 +2054,14 @@ static inline u32 nfsd4_copy_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) ...@@ -2047,6 +2054,14 @@ static inline u32 nfsd4_copy_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)
1 /* cr_synchronous */) * sizeof(__be32); 1 /* cr_synchronous */) * sizeof(__be32);
} }
static inline u32 nfsd4_offload_status_rsize(struct svc_rqst *rqstp,
struct nfsd4_op *op)
{
return (op_encode_hdr_size +
2 /* osr_count */ +
1 /* osr_complete<1> optional 0 for now */) * sizeof(__be32);
}
#ifdef CONFIG_NFSD_PNFS #ifdef CONFIG_NFSD_PNFS
static inline u32 nfsd4_getdeviceinfo_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) static inline u32 nfsd4_getdeviceinfo_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)
{ {
...@@ -2460,6 +2475,11 @@ static const struct nfsd4_operation nfsd4_ops[] = { ...@@ -2460,6 +2475,11 @@ static const struct nfsd4_operation nfsd4_ops[] = {
.op_name = "OP_SEEK", .op_name = "OP_SEEK",
.op_rsize_bop = nfsd4_seek_rsize, .op_rsize_bop = nfsd4_seek_rsize,
}, },
[OP_OFFLOAD_STATUS] = {
.op_func = nfsd4_offload_status,
.op_name = "OP_OFFLOAD_STATUS",
.op_rsize_bop = nfsd4_offload_status_rsize,
},
}; };
/** /**
......
...@@ -1767,6 +1767,13 @@ nfsd4_decode_copy(struct nfsd4_compoundargs *argp, struct nfsd4_copy *copy) ...@@ -1767,6 +1767,13 @@ nfsd4_decode_copy(struct nfsd4_compoundargs *argp, struct nfsd4_copy *copy)
DECODE_TAIL; DECODE_TAIL;
} }
static __be32
nfsd4_decode_offload_status(struct nfsd4_compoundargs *argp,
struct nfsd4_offload_status *os)
{
return nfsd4_decode_stateid(argp, &os->stateid);
}
static __be32 static __be32
nfsd4_decode_seek(struct nfsd4_compoundargs *argp, struct nfsd4_seek *seek) nfsd4_decode_seek(struct nfsd4_compoundargs *argp, struct nfsd4_seek *seek)
{ {
...@@ -1874,7 +1881,7 @@ static const nfsd4_dec nfsd4_dec_ops[] = { ...@@ -1874,7 +1881,7 @@ static const nfsd4_dec nfsd4_dec_ops[] = {
[OP_LAYOUTERROR] = (nfsd4_dec)nfsd4_decode_notsupp, [OP_LAYOUTERROR] = (nfsd4_dec)nfsd4_decode_notsupp,
[OP_LAYOUTSTATS] = (nfsd4_dec)nfsd4_decode_notsupp, [OP_LAYOUTSTATS] = (nfsd4_dec)nfsd4_decode_notsupp,
[OP_OFFLOAD_CANCEL] = (nfsd4_dec)nfsd4_decode_notsupp, [OP_OFFLOAD_CANCEL] = (nfsd4_dec)nfsd4_decode_notsupp,
[OP_OFFLOAD_STATUS] = (nfsd4_dec)nfsd4_decode_notsupp, [OP_OFFLOAD_STATUS] = (nfsd4_dec)nfsd4_decode_offload_status,
[OP_READ_PLUS] = (nfsd4_dec)nfsd4_decode_notsupp, [OP_READ_PLUS] = (nfsd4_dec)nfsd4_decode_notsupp,
[OP_SEEK] = (nfsd4_dec)nfsd4_decode_seek, [OP_SEEK] = (nfsd4_dec)nfsd4_decode_seek,
[OP_WRITE_SAME] = (nfsd4_dec)nfsd4_decode_notsupp, [OP_WRITE_SAME] = (nfsd4_dec)nfsd4_decode_notsupp,
...@@ -4256,6 +4263,22 @@ nfsd4_encode_copy(struct nfsd4_compoundres *resp, __be32 nfserr, ...@@ -4256,6 +4263,22 @@ nfsd4_encode_copy(struct nfsd4_compoundres *resp, __be32 nfserr,
return 0; return 0;
} }
static __be32
nfsd4_encode_offload_status(struct nfsd4_compoundres *resp, __be32 nfserr,
struct nfsd4_offload_status *os)
{
struct xdr_stream *xdr = &resp->xdr;
__be32 *p;
p = xdr_reserve_space(xdr, 8 + 4);
if (!p)
return nfserr_resource;
p = xdr_encode_hyper(p, os->count);
*p++ = cpu_to_be32(0);
return nfserr;
}
static __be32 static __be32
nfsd4_encode_seek(struct nfsd4_compoundres *resp, __be32 nfserr, nfsd4_encode_seek(struct nfsd4_compoundres *resp, __be32 nfserr,
struct nfsd4_seek *seek) struct nfsd4_seek *seek)
...@@ -4359,7 +4382,7 @@ static const nfsd4_enc nfsd4_enc_ops[] = { ...@@ -4359,7 +4382,7 @@ static const nfsd4_enc nfsd4_enc_ops[] = {
[OP_LAYOUTERROR] = (nfsd4_enc)nfsd4_encode_noop, [OP_LAYOUTERROR] = (nfsd4_enc)nfsd4_encode_noop,
[OP_LAYOUTSTATS] = (nfsd4_enc)nfsd4_encode_noop, [OP_LAYOUTSTATS] = (nfsd4_enc)nfsd4_encode_noop,
[OP_OFFLOAD_CANCEL] = (nfsd4_enc)nfsd4_encode_noop, [OP_OFFLOAD_CANCEL] = (nfsd4_enc)nfsd4_encode_noop,
[OP_OFFLOAD_STATUS] = (nfsd4_enc)nfsd4_encode_noop, [OP_OFFLOAD_STATUS] = (nfsd4_enc)nfsd4_encode_offload_status,
[OP_READ_PLUS] = (nfsd4_enc)nfsd4_encode_noop, [OP_READ_PLUS] = (nfsd4_enc)nfsd4_encode_noop,
[OP_SEEK] = (nfsd4_enc)nfsd4_encode_seek, [OP_SEEK] = (nfsd4_enc)nfsd4_encode_seek,
[OP_WRITE_SAME] = (nfsd4_enc)nfsd4_encode_noop, [OP_WRITE_SAME] = (nfsd4_enc)nfsd4_encode_noop,
......
...@@ -545,6 +545,15 @@ struct nfsd4_seek { ...@@ -545,6 +545,15 @@ struct nfsd4_seek {
loff_t seek_pos; loff_t seek_pos;
}; };
struct nfsd4_offload_status {
/* request */
stateid_t stateid;
/* response */
u64 count;
u32 status;
};
struct nfsd4_op { struct nfsd4_op {
int opnum; int opnum;
const struct nfsd4_operation * opdesc; const struct nfsd4_operation * opdesc;
...@@ -603,6 +612,7 @@ struct nfsd4_op { ...@@ -603,6 +612,7 @@ struct nfsd4_op {
struct nfsd4_fallocate deallocate; struct nfsd4_fallocate deallocate;
struct nfsd4_clone clone; struct nfsd4_clone clone;
struct nfsd4_copy copy; struct nfsd4_copy copy;
struct nfsd4_offload_status offload_status;
struct nfsd4_seek seek; struct nfsd4_seek seek;
} u; } u;
struct nfs4_replay * replay; struct nfs4_replay * replay;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment