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
28 /* option to avoid conflicts by returning the delegation */
29 #define DELEGATION_RETURN_ON_CONFLICT
32 /* reference counting and cleanup */
33 void nfs41_delegation_ref(
34 IN nfs41_delegation_state
*state
);
36 void nfs41_delegation_deref(
37 IN nfs41_delegation_state
*state
);
39 void nfs41_client_delegation_free(
40 IN nfs41_client
*client
);
44 int nfs41_delegation_granted(
45 IN nfs41_session
*session
,
46 IN nfs41_path_fh
*parent
,
47 IN nfs41_path_fh
*file
,
48 IN open_delegation4
*delegation
,
49 IN bool_t try_recovery
,
50 OUT nfs41_delegation_state
**deleg_out
);
52 int nfs41_delegate_open(
53 IN nfs41_open_state
*state
,
55 IN OPTIONAL nfs41_file_info
*createattrs
,
56 OUT nfs41_file_info
*info
);
58 int nfs41_delegation_to_open(
59 IN nfs41_open_state
*open
,
60 IN bool_t try_recovery
);
62 void nfs41_delegation_remove_srvopen(
63 IN nfs41_session
*session
,
64 IN nfs41_path_fh
*file
);
66 /* synchronous delegation return */
67 #ifdef DELEGATION_RETURN_ON_CONFLICT
68 int nfs41_delegation_return(
69 IN nfs41_session
*session
,
70 IN nfs41_path_fh
*file
,
72 IN
enum open_delegation_type4 access
,
78 static int nfs41_delegation_return(
79 IN nfs41_session
*session
,
80 IN nfs41_path_fh
*file
,
81 IN
enum open_delegation_type4 access
,
89 /* asynchronous delegation recall */
90 int nfs41_delegation_recall(
91 IN nfs41_client
*client
,
93 IN
const stateid4
*stateid
,
96 int nfs41_delegation_getattr(
97 IN nfs41_client
*client
,
98 IN
const nfs41_fh
*fh
,
99 IN
const bitmap4
*attr_request
,
100 OUT nfs41_file_info
*info
);
103 /* after client state recovery, return any 'recalled' delegations;
104 * must be called under the client's state lock */
105 int nfs41_client_delegation_recovery(
106 IN nfs41_client
*client
);
108 /* attempt to return the least recently used delegation;
109 * fails with NFS4ERR_BADHANDLE if all delegations are in use */
110 int nfs41_client_delegation_return_lru(
111 IN nfs41_client
*client
);
113 #endif /* DELEGATION_H */