aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/state.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/state.h')
-rw-r--r--fs/nfsd/state.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index 4a89e00d7461..bf52dc7b15e7 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -62,16 +62,21 @@ typedef struct {
62 (s)->si_generation 62 (s)->si_generation
63 63
64struct nfsd4_callback { 64struct nfsd4_callback {
65 void *cb_op;
66 struct nfs4_client *cb_clp; 65 struct nfs4_client *cb_clp;
67 struct list_head cb_per_client; 66 struct list_head cb_per_client;
68 u32 cb_minorversion; 67 u32 cb_minorversion;
69 struct rpc_message cb_msg; 68 struct rpc_message cb_msg;
70 const struct rpc_call_ops *cb_ops; 69 struct nfsd4_callback_ops *cb_ops;
71 struct work_struct cb_work; 70 struct work_struct cb_work;
72 bool cb_done; 71 bool cb_done;
73}; 72};
74 73
74struct nfsd4_callback_ops {
75 void (*prepare)(struct nfsd4_callback *);
76 int (*done)(struct nfsd4_callback *, struct rpc_task *);
77 void (*release)(struct nfsd4_callback *);
78};
79
75/* 80/*
76 * A core object that represents a "common" stateid. These are generally 81 * A core object that represents a "common" stateid. These are generally
77 * embedded within the different (more specific) stateid objects and contain 82 * embedded within the different (more specific) stateid objects and contain
@@ -306,6 +311,7 @@ struct nfs4_client {
306#define NFSD4_CLIENT_STABLE (2) /* client on stable storage */ 311#define NFSD4_CLIENT_STABLE (2) /* client on stable storage */
307#define NFSD4_CLIENT_RECLAIM_COMPLETE (3) /* reclaim_complete done */ 312#define NFSD4_CLIENT_RECLAIM_COMPLETE (3) /* reclaim_complete done */
308#define NFSD4_CLIENT_CONFIRMED (4) /* client is confirmed */ 313#define NFSD4_CLIENT_CONFIRMED (4) /* client is confirmed */
314#define NFSD4_CLIENT_UPCALL_LOCK (5) /* upcall serialization */
309#define NFSD4_CLIENT_CB_FLAG_MASK (1 << NFSD4_CLIENT_CB_UPDATE | \ 315#define NFSD4_CLIENT_CB_FLAG_MASK (1 << NFSD4_CLIENT_CB_UPDATE | \
310 1 << NFSD4_CLIENT_CB_KILL) 316 1 << NFSD4_CLIENT_CB_KILL)
311 unsigned long cl_flags; 317 unsigned long cl_flags;
@@ -517,6 +523,13 @@ static inline struct nfs4_ol_stateid *openlockstateid(struct nfs4_stid *s)
517#define RD_STATE 0x00000010 523#define RD_STATE 0x00000010
518#define WR_STATE 0x00000020 524#define WR_STATE 0x00000020
519 525
526enum nfsd4_cb_op {
527 NFSPROC4_CLNT_CB_NULL = 0,
528 NFSPROC4_CLNT_CB_RECALL,
529 NFSPROC4_CLNT_CB_SEQUENCE,
530};
531
532
520struct nfsd4_compound_state; 533struct nfsd4_compound_state;
521struct nfsd_net; 534struct nfsd_net;
522 535
@@ -531,12 +544,12 @@ extern struct nfs4_client_reclaim *nfsd4_find_reclaim_client(const char *recdir,
531extern __be32 nfs4_check_open_reclaim(clientid_t *clid, 544extern __be32 nfs4_check_open_reclaim(clientid_t *clid,
532 struct nfsd4_compound_state *cstate, struct nfsd_net *nn); 545 struct nfsd4_compound_state *cstate, struct nfsd_net *nn);
533extern int set_callback_cred(void); 546extern int set_callback_cred(void);
534void nfsd4_run_cb_null(struct work_struct *w);
535void nfsd4_run_cb_recall(struct work_struct *w);
536extern void nfsd4_probe_callback(struct nfs4_client *clp); 547extern void nfsd4_probe_callback(struct nfs4_client *clp);
537extern void nfsd4_probe_callback_sync(struct nfs4_client *clp); 548extern void nfsd4_probe_callback_sync(struct nfs4_client *clp);
538extern void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *); 549extern void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *);
539extern void nfsd4_cb_recall(struct nfs4_delegation *dp); 550extern void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp,
551 struct nfsd4_callback_ops *ops, enum nfsd4_cb_op op);
552extern void nfsd4_run_cb(struct nfsd4_callback *cb);
540extern int nfsd4_create_callback_queue(void); 553extern int nfsd4_create_callback_queue(void);
541extern void nfsd4_destroy_callback_queue(void); 554extern void nfsd4_destroy_callback_queue(void);
542extern void nfsd4_shutdown_callback(struct nfs4_client *); 555extern void nfsd4_shutdown_callback(struct nfs4_client *);
@@ -545,13 +558,16 @@ extern struct nfs4_client_reclaim *nfs4_client_to_reclaim(const char *name,
545 struct nfsd_net *nn); 558 struct nfsd_net *nn);
546extern bool nfs4_has_reclaimed_state(const char *name, struct nfsd_net *nn); 559extern bool nfs4_has_reclaimed_state(const char *name, struct nfsd_net *nn);
547 560
561/* grace period management */
562void nfsd4_end_grace(struct nfsd_net *nn);
563
548/* nfs4recover operations */ 564/* nfs4recover operations */
549extern int nfsd4_client_tracking_init(struct net *net); 565extern int nfsd4_client_tracking_init(struct net *net);
550extern void nfsd4_client_tracking_exit(struct net *net); 566extern void nfsd4_client_tracking_exit(struct net *net);
551extern void nfsd4_client_record_create(struct nfs4_client *clp); 567extern void nfsd4_client_record_create(struct nfs4_client *clp);
552extern void nfsd4_client_record_remove(struct nfs4_client *clp); 568extern void nfsd4_client_record_remove(struct nfs4_client *clp);
553extern int nfsd4_client_record_check(struct nfs4_client *clp); 569extern int nfsd4_client_record_check(struct nfs4_client *clp);
554extern void nfsd4_record_grace_done(struct nfsd_net *nn, time_t boot_time); 570extern void nfsd4_record_grace_done(struct nfsd_net *nn);
555 571
556/* nfs fault injection functions */ 572/* nfs fault injection functions */
557#ifdef CONFIG_NFSD_FAULT_INJECTION 573#ifdef CONFIG_NFSD_FAULT_INJECTION