diff options
Diffstat (limited to 'fs/nfs/callback.h')
-rw-r--r-- | fs/nfs/callback.h | 59 |
1 files changed, 51 insertions, 8 deletions
diff --git a/fs/nfs/callback.h b/fs/nfs/callback.h index 85a7cfd1b8dd..d3b44f9bd747 100644 --- a/fs/nfs/callback.h +++ b/fs/nfs/callback.h | |||
@@ -34,10 +34,17 @@ enum nfs4_callback_opnum { | |||
34 | OP_CB_ILLEGAL = 10044, | 34 | OP_CB_ILLEGAL = 10044, |
35 | }; | 35 | }; |
36 | 36 | ||
37 | struct cb_process_state { | ||
38 | __be32 drc_status; | ||
39 | struct nfs_client *clp; | ||
40 | struct nfs4_sessionid *svc_sid; /* v4.1 callback service sessionid */ | ||
41 | }; | ||
42 | |||
37 | struct cb_compound_hdr_arg { | 43 | struct cb_compound_hdr_arg { |
38 | unsigned int taglen; | 44 | unsigned int taglen; |
39 | const char *tag; | 45 | const char *tag; |
40 | unsigned int minorversion; | 46 | unsigned int minorversion; |
47 | unsigned int cb_ident; /* v4.0 callback identifier */ | ||
41 | unsigned nops; | 48 | unsigned nops; |
42 | }; | 49 | }; |
43 | 50 | ||
@@ -103,14 +110,23 @@ struct cb_sequenceres { | |||
103 | uint32_t csr_target_highestslotid; | 110 | uint32_t csr_target_highestslotid; |
104 | }; | 111 | }; |
105 | 112 | ||
106 | extern unsigned nfs4_callback_sequence(struct cb_sequenceargs *args, | 113 | extern __be32 nfs4_callback_sequence(struct cb_sequenceargs *args, |
107 | struct cb_sequenceres *res); | 114 | struct cb_sequenceres *res, |
115 | struct cb_process_state *cps); | ||
108 | 116 | ||
109 | extern int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation, | 117 | extern int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation, |
110 | const nfs4_stateid *stateid); | 118 | const nfs4_stateid *stateid); |
111 | 119 | ||
112 | #define RCA4_TYPE_MASK_RDATA_DLG 0 | 120 | #define RCA4_TYPE_MASK_RDATA_DLG 0 |
113 | #define RCA4_TYPE_MASK_WDATA_DLG 1 | 121 | #define RCA4_TYPE_MASK_WDATA_DLG 1 |
122 | #define RCA4_TYPE_MASK_DIR_DLG 2 | ||
123 | #define RCA4_TYPE_MASK_FILE_LAYOUT 3 | ||
124 | #define RCA4_TYPE_MASK_BLK_LAYOUT 4 | ||
125 | #define RCA4_TYPE_MASK_OBJ_LAYOUT_MIN 8 | ||
126 | #define RCA4_TYPE_MASK_OBJ_LAYOUT_MAX 9 | ||
127 | #define RCA4_TYPE_MASK_OTHER_LAYOUT_MIN 12 | ||
128 | #define RCA4_TYPE_MASK_OTHER_LAYOUT_MAX 15 | ||
129 | #define RCA4_TYPE_MASK_ALL 0xf31f | ||
114 | 130 | ||
115 | struct cb_recallanyargs { | 131 | struct cb_recallanyargs { |
116 | struct sockaddr *craa_addr; | 132 | struct sockaddr *craa_addr; |
@@ -118,25 +134,52 @@ struct cb_recallanyargs { | |||
118 | uint32_t craa_type_mask; | 134 | uint32_t craa_type_mask; |
119 | }; | 135 | }; |
120 | 136 | ||
121 | extern unsigned nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy); | 137 | extern __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, |
138 | void *dummy, | ||
139 | struct cb_process_state *cps); | ||
122 | 140 | ||
123 | struct cb_recallslotargs { | 141 | struct cb_recallslotargs { |
124 | struct sockaddr *crsa_addr; | 142 | struct sockaddr *crsa_addr; |
125 | uint32_t crsa_target_max_slots; | 143 | uint32_t crsa_target_max_slots; |
126 | }; | 144 | }; |
127 | extern unsigned nfs4_callback_recallslot(struct cb_recallslotargs *args, | 145 | extern __be32 nfs4_callback_recallslot(struct cb_recallslotargs *args, |
128 | void *dummy); | 146 | void *dummy, |
147 | struct cb_process_state *cps); | ||
148 | |||
149 | struct cb_layoutrecallargs { | ||
150 | struct sockaddr *cbl_addr; | ||
151 | uint32_t cbl_recall_type; | ||
152 | uint32_t cbl_layout_type; | ||
153 | uint32_t cbl_layoutchanged; | ||
154 | union { | ||
155 | struct { | ||
156 | struct nfs_fh cbl_fh; | ||
157 | struct pnfs_layout_range cbl_range; | ||
158 | nfs4_stateid cbl_stateid; | ||
159 | }; | ||
160 | struct nfs_fsid cbl_fsid; | ||
161 | }; | ||
162 | }; | ||
129 | 163 | ||
130 | #endif /* CONFIG_NFS_V4_1 */ | 164 | extern unsigned nfs4_callback_layoutrecall( |
165 | struct cb_layoutrecallargs *args, | ||
166 | void *dummy, struct cb_process_state *cps); | ||
131 | 167 | ||
132 | extern __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res); | 168 | extern void nfs4_check_drain_bc_complete(struct nfs4_session *ses); |
133 | extern __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy); | 169 | extern void nfs4_cb_take_slot(struct nfs_client *clp); |
170 | #endif /* CONFIG_NFS_V4_1 */ | ||
134 | 171 | ||
172 | extern __be32 nfs4_callback_getattr(struct cb_getattrargs *args, | ||
173 | struct cb_getattrres *res, | ||
174 | struct cb_process_state *cps); | ||
175 | extern __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy, | ||
176 | struct cb_process_state *cps); | ||
135 | #ifdef CONFIG_NFS_V4 | 177 | #ifdef CONFIG_NFS_V4 |
136 | extern int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt); | 178 | extern int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt); |
137 | extern void nfs_callback_down(int minorversion); | 179 | extern void nfs_callback_down(int minorversion); |
138 | extern int nfs4_validate_delegation_stateid(struct nfs_delegation *delegation, | 180 | extern int nfs4_validate_delegation_stateid(struct nfs_delegation *delegation, |
139 | const nfs4_stateid *stateid); | 181 | const nfs4_stateid *stateid); |
182 | extern int nfs4_set_callback_sessionid(struct nfs_client *clp); | ||
140 | #endif /* CONFIG_NFS_V4 */ | 183 | #endif /* CONFIG_NFS_V4 */ |
141 | /* | 184 | /* |
142 | * nfs41: Callbacks are expected to not cause substantial latency, | 185 | * nfs41: Callbacks are expected to not cause substantial latency, |