summaryrefslogtreecommitdiff
path: root/include/linux/nfsd
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2004-06-26 20:58:41 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-06-26 20:58:41 -0700
commitd9c43f5e02d3f5fed13fc3b798d992ffaf3f6829 (patch)
tree36971494776c8c93b352ac6949008402e357888e /include/linux/nfsd
parent1ad75126cc25493618d3d96afb839601c3ff235f (diff)
[PATCH] knfsd: allow user to set NFSv4 lease time.
Allow the lease to be set from /proc/fs/nfs/nfsv4leasetime. To comply with rfc3530, this appears as a server reboot from the point of view of the client, which must reclaim state with the grace period. From: Andy Adamson <andros@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@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>
Diffstat (limited to 'include/linux/nfsd')
-rw-r--r--include/linux/nfsd/nfsd.h6
-rw-r--r--include/linux/nfsd/state.h15
2 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index e1818525627b..520f00b1e8c3 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -126,9 +126,13 @@ int nfsd_permission(struct svc_export *, struct dentry *, int);
#ifdef CONFIG_NFSD_V4
void nfs4_state_init(void);
void nfs4_state_shutdown(void);
+time_t nfs4_lease_time(void);
+void nfs4_reset_lease(time_t leasetime);
#else
void static inline nfs4_state_init(void){}
void static inline nfs4_state_shutdown(void){}
+time_t static inline nfs4_lease_time(void){return 0;}
+void static inline nfs4_reset_lease(time_t leasetime){}
#endif
/*
@@ -249,7 +253,7 @@ static inline int is_fsid(struct svc_fh *fh, struct knfsd_fh *reffh)
#define COMPOUND_SLACK_SPACE 140 /* OP_GETFH */
#define COMPOUND_ERR_SLACK_SPACE 12 /* OP_SETATTR */
-#define NFSD_LEASE_TIME 60 /* seconds */
+#define NFSD_LEASE_TIME (nfs4_lease_time())
#define NFSD_LAUNDROMAT_MINTIMEOUT 10 /* seconds */
/*
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index 51d00f6ebf97..32ffcd82d2ce 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -105,6 +105,19 @@ struct nfs4_client {
clientid_t cl_clientid; /* generated by server */
nfs4_verifier cl_confirm; /* generated by server */
struct nfs4_callback cl_callback; /* callback info */
+ time_t cl_first_state; /* first state aquisition*/
+};
+
+/* struct nfs4_client_reset
+ * one per old client. Populates reset_str_hashtbl. Filled from conf_id_hashtbl
+ * upon lease reset, or from upcall to state_daemon (to read in state
+ * from non-volitile storage) upon reboot.
+ */
+struct nfs4_client_reclaim {
+ struct list_head cr_strhash; /* hash by cr_name */
+ struct xdr_netobj cr_name; /* id generated by client */
+ time_t cr_first_state; /* first state aquisition */
+ u32 cr_expired; /* boolean: lease expired? */
};
static inline void
@@ -234,5 +247,5 @@ extern int nfs4_share_conflict(struct svc_fh *current_fh,
extern void nfs4_lock_state(void);
extern void nfs4_unlock_state(void);
extern int nfs4_in_grace(void);
-extern int nfs4_in_no_grace(void);
+extern int nfs4_check_open_reclaim(clientid_t *clid);
#endif /* NFSD4_STATE_H */