Commit ab5e347f authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] knfsd: add the DELEGRETURN operation.

Signed-off-by: default avatarAndy Adamson <andros@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 268b9345
...@@ -840,6 +840,9 @@ nfsd4_proc_compound(struct svc_rqst *rqstp, ...@@ -840,6 +840,9 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
case OP_CREATE: case OP_CREATE:
op->status = nfsd4_create(rqstp, current_fh, &op->u.create); op->status = nfsd4_create(rqstp, current_fh, &op->u.create);
break; break;
case OP_DELEGRETURN:
op->status = nfsd4_delegreturn(rqstp, current_fh, &op->u.delegreturn);
break;
case OP_GETATTR: case OP_GETATTR:
op->status = nfsd4_getattr(rqstp, current_fh, &op->u.getattr); op->status = nfsd4_getattr(rqstp, current_fh, &op->u.getattr);
break; break;
......
...@@ -2332,6 +2332,22 @@ nfsd4_close(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_clos ...@@ -2332,6 +2332,22 @@ nfsd4_close(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_clos
return status; return status;
} }
int
nfsd4_delegreturn(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_delegreturn *dr)
{
int status;
if ((status = fh_verify(rqstp, current_fh, S_IFREG, 0)))
goto out;
nfs4_lock_state();
status = nfs4_preprocess_stateid_op(current_fh, &dr->dr_stateid, DELEG_RET);
nfs4_unlock_state();
out:
return status;
}
/* /*
* Lock owner state (byte-range locks) * Lock owner state (byte-range locks)
*/ */
......
...@@ -614,6 +614,18 @@ nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create ...@@ -614,6 +614,18 @@ nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create
DECODE_TAIL; DECODE_TAIL;
} }
static inline int
nfsd4_decode_delegreturn(struct nfsd4_compoundargs *argp, struct nfsd4_delegreturn *dr)
{
DECODE_HEAD;
READ_BUF(sizeof(stateid_t));
READ32(dr->dr_stateid.si_generation);
COPYMEM(&dr->dr_stateid.si_opaque, sizeof(stateid_opaque_t));
DECODE_TAIL;
}
static inline int static inline int
nfsd4_decode_getattr(struct nfsd4_compoundargs *argp, struct nfsd4_getattr *getattr) nfsd4_decode_getattr(struct nfsd4_compoundargs *argp, struct nfsd4_getattr *getattr)
{ {
...@@ -1170,6 +1182,9 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp) ...@@ -1170,6 +1182,9 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
case OP_CREATE: case OP_CREATE:
op->status = nfsd4_decode_create(argp, &op->u.create); op->status = nfsd4_decode_create(argp, &op->u.create);
break; break;
case OP_DELEGRETURN:
op->status = nfsd4_decode_delegreturn(argp, &op->u.delegreturn);
break;
case OP_GETATTR: case OP_GETATTR:
op->status = nfsd4_decode_getattr(argp, &op->u.getattr); op->status = nfsd4_decode_getattr(argp, &op->u.getattr);
break; break;
...@@ -2451,6 +2466,8 @@ nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op) ...@@ -2451,6 +2466,8 @@ nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op)
case OP_CREATE: case OP_CREATE:
nfsd4_encode_create(resp, op->status, &op->u.create); nfsd4_encode_create(resp, op->status, &op->u.create);
break; break;
case OP_DELEGRETURN:
break;
case OP_GETATTR: case OP_GETATTR:
op->status = nfsd4_encode_getattr(resp, op->status, &op->u.getattr); op->status = nfsd4_encode_getattr(resp, op->status, &op->u.getattr);
break; break;
......
...@@ -94,6 +94,10 @@ struct nfsd4_create { ...@@ -94,6 +94,10 @@ struct nfsd4_create {
#define cr_specdata1 u.dev.specdata1 #define cr_specdata1 u.dev.specdata1
#define cr_specdata2 u.dev.specdata2 #define cr_specdata2 u.dev.specdata2
struct nfsd4_delegreturn {
stateid_t dr_stateid;
};
struct nfsd4_getattr { struct nfsd4_getattr {
u32 ga_bmval[2]; /* request */ u32 ga_bmval[2]; /* request */
struct svc_fh *ga_fhp; /* response */ struct svc_fh *ga_fhp; /* response */
...@@ -335,6 +339,7 @@ struct nfsd4_op { ...@@ -335,6 +339,7 @@ struct nfsd4_op {
struct nfsd4_close close; struct nfsd4_close close;
struct nfsd4_commit commit; struct nfsd4_commit commit;
struct nfsd4_create create; struct nfsd4_create create;
struct nfsd4_delegreturn delegreturn;
struct nfsd4_getattr getattr; struct nfsd4_getattr getattr;
struct svc_fh * getfh; struct svc_fh * getfh;
struct nfsd4_link link; struct nfsd4_link link;
...@@ -446,6 +451,8 @@ extern int ...@@ -446,6 +451,8 @@ extern int
nfsd4_release_lockowner(struct svc_rqst *rqstp, nfsd4_release_lockowner(struct svc_rqst *rqstp,
struct nfsd4_release_lockowner *rlockowner); struct nfsd4_release_lockowner *rlockowner);
extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *); extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *);
extern int nfsd4_delegreturn(struct svc_rqst *rqstp,
struct svc_fh *current_fh, struct nfsd4_delegreturn *dr);
#endif #endif
/* /*
......
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