diff options
Diffstat (limited to 'fs/nfsd/state.h')
-rw-r--r-- | fs/nfsd/state.h | 28 |
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 | ||
64 | struct nfsd4_callback { | 64 | struct 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 | ||
74 | struct 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 | ||
526 | enum nfsd4_cb_op { | ||
527 | NFSPROC4_CLNT_CB_NULL = 0, | ||
528 | NFSPROC4_CLNT_CB_RECALL, | ||
529 | NFSPROC4_CLNT_CB_SEQUENCE, | ||
530 | }; | ||
531 | |||
532 | |||
520 | struct nfsd4_compound_state; | 533 | struct nfsd4_compound_state; |
521 | struct nfsd_net; | 534 | struct nfsd_net; |
522 | 535 | ||
@@ -531,12 +544,12 @@ extern struct nfs4_client_reclaim *nfsd4_find_reclaim_client(const char *recdir, | |||
531 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid, | 544 | extern __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); |
533 | extern int set_callback_cred(void); | 546 | extern int set_callback_cred(void); |
534 | void nfsd4_run_cb_null(struct work_struct *w); | ||
535 | void nfsd4_run_cb_recall(struct work_struct *w); | ||
536 | extern void nfsd4_probe_callback(struct nfs4_client *clp); | 547 | extern void nfsd4_probe_callback(struct nfs4_client *clp); |
537 | extern void nfsd4_probe_callback_sync(struct nfs4_client *clp); | 548 | extern void nfsd4_probe_callback_sync(struct nfs4_client *clp); |
538 | extern void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *); | 549 | extern void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *); |
539 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); | 550 | extern void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp, |
551 | struct nfsd4_callback_ops *ops, enum nfsd4_cb_op op); | ||
552 | extern void nfsd4_run_cb(struct nfsd4_callback *cb); | ||
540 | extern int nfsd4_create_callback_queue(void); | 553 | extern int nfsd4_create_callback_queue(void); |
541 | extern void nfsd4_destroy_callback_queue(void); | 554 | extern void nfsd4_destroy_callback_queue(void); |
542 | extern void nfsd4_shutdown_callback(struct nfs4_client *); | 555 | extern 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); |
546 | extern bool nfs4_has_reclaimed_state(const char *name, struct nfsd_net *nn); | 559 | extern bool nfs4_has_reclaimed_state(const char *name, struct nfsd_net *nn); |
547 | 560 | ||
561 | /* grace period management */ | ||
562 | void nfsd4_end_grace(struct nfsd_net *nn); | ||
563 | |||
548 | /* nfs4recover operations */ | 564 | /* nfs4recover operations */ |
549 | extern int nfsd4_client_tracking_init(struct net *net); | 565 | extern int nfsd4_client_tracking_init(struct net *net); |
550 | extern void nfsd4_client_tracking_exit(struct net *net); | 566 | extern void nfsd4_client_tracking_exit(struct net *net); |
551 | extern void nfsd4_client_record_create(struct nfs4_client *clp); | 567 | extern void nfsd4_client_record_create(struct nfs4_client *clp); |
552 | extern void nfsd4_client_record_remove(struct nfs4_client *clp); | 568 | extern void nfsd4_client_record_remove(struct nfs4_client *clp); |
553 | extern int nfsd4_client_record_check(struct nfs4_client *clp); | 569 | extern int nfsd4_client_record_check(struct nfs4_client *clp); |
554 | extern void nfsd4_record_grace_done(struct nfsd_net *nn, time_t boot_time); | 570 | extern 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 |