1 /* NFSv4.1 client for Windows
2 * Copyright © 2012 The Regents of the University of Michigan
4 * Olga Kornievskaia <aglo@umich.edu>
5 * Casey Bodley <cbodley@umich.edu>
7 * This library is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation; either version 2.1 of the License, or (at
10 * your option) any later version.
12 * This library is distributed in the hope that it will be useful, but
13 * without any warranty; without even the implied warranty of merchantability
14 * or fitness for a particular purpose. See the GNU Lesser General Public
15 * License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 #ifndef __NFS41_CALLBACK_H__
23 #define __NFS41_CALLBACK_H__
27 #include "nfs41_types.h"
30 enum nfs41_callback_proc
{
35 enum nfs41_callback_op
{
38 OP_CB_LAYOUTRECALL
= 5,
42 OP_CB_RECALLABLE_OBJ_AVAIL
= 9,
43 OP_CB_RECALL_SLOT
= 10,
45 OP_CB_WANTS_CANCELLED
= 12,
46 OP_CB_NOTIFY_LOCK
= 13,
47 OP_CB_NOTIFY_DEVICEID
= 14,
51 int nfs41_handle_callback(void *, void *, void *);
53 /* OP_CB_LAYOUTRECALL */
54 struct cb_recall_file
{
60 union cb_recall_file_args
{
61 struct cb_recall_file file
;
68 enum pnfs_return_type type
;
70 union cb_recall_file_args args
;
72 struct cb_layoutrecall_args
{
77 enum pnfs_return_type type
;
78 enum pnfs_iomode iomode
;
81 struct cb_recall recall
;
84 struct cb_layoutrecall_res
{
88 /* OP_CB_RECALL_SLOT */
89 struct cb_recall_slot_args
{
90 uint32_t target_highest_slotid
;
93 struct cb_recall_slot_res
{
98 struct cb_sequence_ref
{
102 struct cb_sequence_ref_list
{
103 char sessionid
[NFS4_SESSIONID_SIZE
];
104 struct cb_sequence_ref
*calls
;
107 struct cb_sequence_args
{
108 char sessionid
[NFS4_SESSIONID_SIZE
];
111 uint32_t highest_slotid
;
113 struct cb_sequence_ref_list
*ref_lists
;
114 uint32_t ref_list_count
;
117 struct cb_sequence_res_ok
{
118 char sessionid
[NFS4_SESSIONID_SIZE
];
121 uint32_t highest_slotid
;
122 uint32_t target_highest_slotid
;
124 struct cb_sequence_res
{
126 struct cb_sequence_res_ok ok
;
130 struct cb_getattr_args
{
132 bitmap4 attr_request
;
135 struct cb_getattr_res
{
137 nfs41_file_info info
;
141 struct cb_recall_args
{
147 struct cb_recall_res
{
152 struct cb_notify_args
{
153 uint32_t target_highest_slotid
;
156 struct cb_notify_res
{
160 /* OP_CB_PUSH_DELEG */
161 struct cb_push_deleg_args
{
162 uint32_t target_highest_slotid
;
165 struct cb_push_deleg_res
{
169 /* OP_CB_RECALL_ANY */
170 struct cb_recall_any_args
{
171 uint32_t target_highest_slotid
;
174 struct cb_recall_any_res
{
178 /* OP_CB_RECALLABLE_OBJ_AVAIL */
179 struct cb_recallable_obj_avail_args
{
180 uint32_t target_highest_slotid
;
183 struct cb_recallable_obj_avail_res
{
187 /* OP_CB_WANTS_CANCELLED */
188 struct cb_wants_cancelled_args
{
189 uint32_t target_highest_slotid
;
192 struct cb_wants_cancelled_res
{
196 /* OP_CB_NOTIFY_LOCK */
197 struct cb_notify_lock_args
{
198 uint32_t target_highest_slotid
;
201 struct cb_notify_lock_res
{
205 /* OP_CB_NOTIFY_DEVICEID */
206 enum notify_deviceid_type4
{
207 NOTIFY_DEVICEID4_CHANGE
= 1,
208 NOTIFY_DEVICEID4_DELETE
= 2
210 struct notify_deviceid4
{
211 unsigned char deviceid
[16];
212 enum notify_deviceid_type4 type
;
216 enum pnfs_layout_type layouttype
;
225 struct cb_notify_deviceid_args
{
226 struct notify4
*notify_list
;
227 uint32_t notify_count
;
228 struct notify_deviceid4
*change_list
;
229 uint32_t change_count
;
232 struct cb_notify_deviceid_res
{
237 #define CB_COMPOUND_MAX_TAG 64
238 #define CB_COMPOUND_MAX_OPERATIONS 16
241 struct cb_layoutrecall_args layoutrecall
;
242 struct cb_recall_slot_args recall_slot
;
243 struct cb_sequence_args sequence
;
244 struct cb_getattr_args getattr
;
245 struct cb_recall_args recall
;
246 struct cb_notify_deviceid_args notify_deviceid
;
250 union cb_op_args args
;
252 struct cb_compound_tag
{
253 char str
[CB_COMPOUND_MAX_TAG
];
256 struct cb_compound_args
{
257 struct cb_compound_tag tag
;
258 uint32_t minorversion
;
259 uint32_t callback_ident
; /* client MUST ignore */
260 struct cb_argop
*argarray
;
261 uint32_t argarray_count
; /* <= CB_COMPOUND_MAX_OPERATIONS */
265 enum_t status
; /* all results start with status */
266 struct cb_layoutrecall_res layoutrecall
;
267 struct cb_recall_slot_res recall_slot
;
268 struct cb_sequence_res sequence
;
269 struct cb_getattr_res getattr
;
270 struct cb_recall_res recall
;
271 struct cb_notify_deviceid_res notify_deviceid
;
278 struct cb_compound_res
{
280 struct cb_compound_tag tag
;
281 struct cb_resop
*resarray
;
282 uint32_t resarray_count
; /* <= CB_COMPOUND_MAX_OPERATIONS */
287 bool_t
proc_cb_compound_args(XDR
*xdr
, struct cb_compound_args
*args
);
288 bool_t
proc_cb_compound_res(XDR
*xdr
, struct cb_compound_res
*res
);
290 /* callback_server.c */
291 struct __nfs41_session
;
292 void nfs41_callback_session_init(
293 IN
struct __nfs41_session
*session
);
295 #endif /* !__NFS41_CALLBACK_H__ */