#ifndef _LINUX_NFSD_XDR4_H
#define _LINUX_NFSD_XDR4_H
+#include <linux/nfs4.h>
+
#define NFSD4_MAX_TAGLEN 128
#define XDR_LEN(n) (((n) + 3) & ~3)
-typedef u32 delegation_zero_t;
-typedef u32 delegation_boot_t;
-typedef u64 delegation_id_t;
-
-typedef struct {
- delegation_zero_t ds_zero;
- delegation_boot_t ds_boot;
- delegation_id_t ds_id;
-} delegation_stateid_t;
+struct nfsd4_compound_state {
+ struct svc_fh current_fh;
+ struct svc_fh save_fh;
+ struct nfs4_stateowner *replay_owner;
+};
struct nfsd4_change_info {
u32 atomic;
u32 cr_bmval[2]; /* request */
struct iattr cr_iattr; /* request */
struct nfsd4_change_info cr_cinfo; /* response */
+ struct nfs4_acl *cr_acl;
};
#define cr_linklen u.link.namelen
#define cr_linkname u.link.name
#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 */
};
struct nfsd4_lock_denied {
+ clientid_t ld_clientid;
struct nfs4_stateowner *ld_sop;
u64 ld_start;
u64 ld_length;
} ok;
struct nfsd4_lock_denied denied;
} u;
-
- struct nfs4_stateowner *lk_stateowner;
+ /* The lk_replay_owner is the open owner in the open_to_lock_owner
+ * case and the lock owner otherwise: */
+ struct nfs4_stateowner *lk_replay_owner;
};
#define lk_new_open_seqid v.new.open_seqid
#define lk_new_open_stateid v.new.open_stateid
u32 op_claim_type; /* request */
struct xdr_netobj op_fname; /* request - everything but CLAIM_PREV */
u32 op_delegate_type; /* request - CLAIM_PREV only */
- delegation_stateid_t op_delegate_stateid; /* request - CLAIM_DELEGATE_CUR only */
+ stateid_t op_delegate_stateid; /* request - response */
u32 op_create; /* request */
u32 op_createmode; /* request */
u32 op_bmval[2]; /* request */
union { /* request */
- struct iattr iattr; /* UNCHECKED4,GUARDED4 */
- nfs4_verifier verf; /* EXCLUSIVE4 */
+ struct iattr iattr; /* UNCHECKED4,GUARDED4 */
+ nfs4_verifier verf; /* EXCLUSIVE4 */
} u;
clientid_t op_clientid; /* request */
struct xdr_netobj op_owner; /* request */
u32 op_share_access; /* request */
u32 op_share_deny; /* request */
stateid_t op_stateid; /* response */
+ u32 op_recall; /* recall */
struct nfsd4_change_info op_cinfo; /* response */
u32 op_rflags; /* response */
int op_truncate; /* used during processing */
struct nfs4_stateowner *op_stateowner; /* used during processing */
-
+ struct nfs4_acl *op_acl;
};
#define op_iattr u.iattr
#define op_verf u.verf
stateid_t rd_stateid; /* request */
u64 rd_offset; /* request */
u32 rd_length; /* request */
- struct kvec rd_iov[RPCSVC_MAXPAGES];
int rd_vlen;
+ struct file *rd_filp;
struct svc_rqst *rd_rqstp; /* response */
struct svc_fh * rd_fhp; /* response */
struct svc_fh * rd_fhp; /* response */
struct readdir_cd common;
- u32 * buffer;
+ __be32 * buffer;
int buflen;
- u32 * offset;
+ __be32 * offset;
};
struct nfsd4_release_lockowner {
stateid_t sa_stateid; /* request */
u32 sa_bmval[2]; /* request */
struct iattr sa_iattr; /* request */
+ struct nfs4_acl *sa_acl;
};
struct nfsd4_setclientid {
u64 wr_offset; /* request */
u32 wr_stable_how; /* request */
u32 wr_buflen; /* request */
- struct kvec wr_vec[RPCSVC_MAXPAGES]; /* request */
int wr_vlen;
u32 wr_bytes_written; /* response */
struct nfsd4_op {
int opnum;
- int status;
+ __be32 status;
union {
struct nfsd4_access access;
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;
struct nfsd4_compoundargs {
/* scratch variables for XDR decode */
- u32 * p;
- u32 * end;
+ __be32 * p;
+ __be32 * end;
struct page ** pagelist;
int pagelen;
- u32 tmp[8];
- u32 * tmpp;
+ __be32 tmp[8];
+ __be32 * tmpp;
struct tmpbuf {
struct tmpbuf *next;
void (*release)(const void *);
struct nfsd4_compoundres {
/* scratch variables for XDR encode */
- u32 * p;
- u32 * end;
+ __be32 * p;
+ __be32 * end;
struct xdr_buf * xbuf;
struct svc_rqst * rqstp;
u32 taglen;
char * tag;
u32 opcnt;
- u32 * tagp; /* where to encode tag and opcount */
+ __be32 * tagp; /* where to encode tag and opcount */
};
#define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs)
cinfo->after_ctime_nsec = fhp->fh_post_ctime.tv_nsec;
}
-int nfs4svc_encode_voidres(struct svc_rqst *, u32 *, void *);
-int nfs4svc_decode_compoundargs(struct svc_rqst *, u32 *,
+int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
+int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *,
struct nfsd4_compoundargs *);
-int nfs4svc_encode_compoundres(struct svc_rqst *, u32 *,
+int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *,
struct nfsd4_compoundres *);
void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *);
void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op);
-int nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
- struct dentry *dentry, u32 *buffer, int *countp,
+__be32 nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
+ struct dentry *dentry, __be32 *buffer, int *countp,
u32 *bmval, struct svc_rqst *);
-extern int nfsd4_setclientid(struct svc_rqst *rqstp,
+extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp,
+ struct nfsd4_compound_state *,
struct nfsd4_setclientid *setclid);
-extern int nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
+extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
+ struct nfsd4_compound_state *,
struct nfsd4_setclientid_confirm *setclientid_confirm);
-extern int nfsd4_process_open1(struct nfsd4_open *open);
-extern int nfsd4_process_open2(struct svc_rqst *rqstp,
+extern __be32 nfsd4_process_open1(struct nfsd4_open *open);
+extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp,
struct svc_fh *current_fh, struct nfsd4_open *open);
-extern int nfsd4_open_confirm(struct svc_rqst *rqstp,
- struct svc_fh *current_fh, struct nfsd4_open_confirm *oc);
-extern int nfsd4_close(struct svc_rqst *rqstp, struct svc_fh *current_fh,
+extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp,
+ struct nfsd4_compound_state *, struct nfsd4_open_confirm *oc);
+extern __be32 nfsd4_close(struct svc_rqst *rqstp,
+ struct nfsd4_compound_state *,
struct nfsd4_close *close);
-extern int nfsd4_open_downgrade(struct svc_rqst *rqstp,
- struct svc_fh *current_fh, struct nfsd4_open_downgrade *od);
-extern int nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh,
+extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp,
+ struct nfsd4_compound_state *,
+ struct nfsd4_open_downgrade *od);
+extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
struct nfsd4_lock *lock);
-extern int nfsd4_lockt(struct svc_rqst *rqstp, struct svc_fh *current_fh,
+extern __be32 nfsd4_lockt(struct svc_rqst *rqstp,
+ struct nfsd4_compound_state *,
struct nfsd4_lockt *lockt);
-extern int nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh,
+extern __be32 nfsd4_locku(struct svc_rqst *rqstp,
+ struct nfsd4_compound_state *,
struct nfsd4_locku *locku);
-extern int
+extern __be32
nfsd4_release_lockowner(struct svc_rqst *rqstp,
+ struct nfsd4_compound_state *,
struct nfsd4_release_lockowner *rlockowner);
extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *);
+extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp,
+ struct nfsd4_compound_state *, struct nfsd4_delegreturn *dr);
+extern __be32 nfsd4_renew(struct svc_rqst *rqstp,
+ struct nfsd4_compound_state *, clientid_t *clid);
#endif
/*