summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2005-01-04 05:52:12 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-04 05:52:12 -0800
commitab5e347f143f8138d24b77d9daa7ff2b5184355b (patch)
tree25dde7db3e350cb44db6dc9da339fa35760556dc
parent268b934510490eb490e88d7b0fa1a7b6c4d1ff04 (diff)
[PATCH] knfsd: add the DELEGRETURN operation.
Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/nfsd/nfs4proc.c3
-rw-r--r--fs/nfsd/nfs4state.c16
-rw-r--r--fs/nfsd/nfs4xdr.c17
-rw-r--r--include/linux/nfsd/xdr4.h7
4 files changed, 43 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index cd0e552b2ce1..6c23964e6155 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -840,6 +840,9 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
case OP_CREATE:
op->status = nfsd4_create(rqstp, current_fh, &op->u.create);
break;
+ case OP_DELEGRETURN:
+ op->status = nfsd4_delegreturn(rqstp, current_fh, &op->u.delegreturn);
+ break;
case OP_GETATTR:
op->status = nfsd4_getattr(rqstp, current_fh, &op->u.getattr);
break;
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 39f98a4834fb..03db87d5a63a 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2332,6 +2332,22 @@ out:
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)
*/
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 563367b437fb..7abe3d33ace5 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -615,6 +615,18 @@ nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create
}
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
nfsd4_decode_getattr(struct nfsd4_compoundargs *argp, struct nfsd4_getattr *getattr)
{
return nfsd4_decode_bitmap(argp, getattr->ga_bmval);
@@ -1170,6 +1182,9 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
case OP_CREATE:
op->status = nfsd4_decode_create(argp, &op->u.create);
break;
+ case OP_DELEGRETURN:
+ op->status = nfsd4_decode_delegreturn(argp, &op->u.delegreturn);
+ break;
case OP_GETATTR:
op->status = nfsd4_decode_getattr(argp, &op->u.getattr);
break;
@@ -2451,6 +2466,8 @@ nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op)
case OP_CREATE:
nfsd4_encode_create(resp, op->status, &op->u.create);
break;
+ case OP_DELEGRETURN:
+ break;
case OP_GETATTR:
op->status = nfsd4_encode_getattr(resp, op->status, &op->u.getattr);
break;
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index e201151f48be..a63238354be7 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -94,6 +94,10 @@ struct nfsd4_create {
#define cr_specdata1 u.dev.specdata1
#define cr_specdata2 u.dev.specdata2
+struct nfsd4_delegreturn {
+ stateid_t dr_stateid;
+};
+
struct nfsd4_getattr {
u32 ga_bmval[2]; /* request */
struct svc_fh *ga_fhp; /* response */
@@ -335,6 +339,7 @@ struct nfsd4_op {
struct nfsd4_close close;
struct nfsd4_commit commit;
struct nfsd4_create create;
+ struct nfsd4_delegreturn delegreturn;
struct nfsd4_getattr getattr;
struct svc_fh * getfh;
struct nfsd4_link link;
@@ -446,6 +451,8 @@ extern int
nfsd4_release_lockowner(struct svc_rqst *rqstp,
struct nfsd4_release_lockowner *rlockowner);
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
/*