Commit 1dcde038 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] knfsd: add structures for delegation support

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 82bd687c
......@@ -67,6 +67,41 @@ extern stateid_t onestateid;
#define ZERO_STATEID(stateid) (!memcmp((stateid), &zerostateid, sizeof(stateid_t)))
#define ONE_STATEID(stateid) (!memcmp((stateid), &onestateid, sizeof(stateid_t)))
/* Delegation recall states */
#define NFS4_NO_RECALL 0x000
#define NFS4_RECALL_IN_PROGRESS 0x001
#define NFS4_RECALL_COMPLETE 0x002
#define NFS4_REAP_DELEG 0x004
struct nfs4_cb_recall {
u32 cbr_ident;
int cbr_trunc;
stateid_t cbr_stateid;
u32 cbr_fhlen;
u32 cbr_fhval[NFS4_FHSIZE];
struct nfs4_delegation *cbr_dp;
};
struct nfs4_delegation {
struct list_head dl_del_perfile; /* nfs4_file->fi_del_perfile */
struct list_head dl_del_perclnt; /* nfs4_client->cl_del_perclnt*/
struct list_head dl_recall_lru; /* delegation recalled */
atomic_t dl_recall_cnt; /* resend cb_recall only once */
atomic_t dl_count; /* ref count */
atomic_t dl_state; /* recall state */
struct nfs4_client *dl_client;
struct nfs4_file *dl_file;
struct file_lock *dl_flock;
struct nfs4_stateid *dl_stp;
u32 dl_type;
time_t dl_time;
struct nfs4_cb_recall dl_recall;
};
#define dl_stateid dl_recall.cbr_stateid
#define dl_fhlen dl_recall.cbr_fhlen
#define dl_fhval dl_recall.cbr_fhval
/* client delegation callback info */
struct nfs4_callback {
/* SETCLIENTID info */
......@@ -96,6 +131,7 @@ struct nfs4_client {
struct list_head cl_idhash; /* hash by cl_clientid.id */
struct list_head cl_strhash; /* hash by cl_name */
struct list_head cl_perclient; /* list: stateowners */
struct list_head cl_del_perclnt; /* list: delegations */
struct list_head cl_lru; /* tail queue */
struct xdr_netobj cl_name; /* id generated by client */
nfs4_verifier cl_verifier; /* generated by client */
......@@ -194,6 +230,7 @@ struct nfs4_stateowner {
struct nfs4_file {
struct list_head fi_hash; /* hash by "struct inode *" */
struct list_head fi_perfile; /* list: nfs4_stateid */
struct list_head fi_del_perfile; /* list: nfs4_delegation */
struct inode *fi_inode;
u32 fi_id; /* used with stateowner->so_id
* for stateid_hashtbl hash */
......
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