[SNDVOL32] Advanced controls dialog: Remove the TBS_AUTOTICKS style from the trackbar...
[reactos.git] / base / services / nfsd / delegation.h
1 /* NFSv4.1 client for Windows
2 * Copyright © 2012 The Regents of the University of Michigan
3 *
4 * Olga Kornievskaia <aglo@umich.edu>
5 * Casey Bodley <cbodley@umich.edu>
6 *
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.
11 *
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.
16 *
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
20 */
21
22 #ifndef DELEGATION_H
23 #define DELEGATION_H
24
25 #include "nfs41.h"
26
27
28 /* option to avoid conflicts by returning the delegation */
29 #define DELEGATION_RETURN_ON_CONFLICT
30
31
32 /* reference counting and cleanup */
33 void nfs41_delegation_ref(
34 IN nfs41_delegation_state *state);
35
36 void nfs41_delegation_deref(
37 IN nfs41_delegation_state *state);
38
39 void nfs41_client_delegation_free(
40 IN nfs41_client *client);
41
42
43 /* open delegation */
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);
51
52 int nfs41_delegate_open(
53 IN nfs41_open_state *state,
54 IN uint32_t create,
55 IN OPTIONAL nfs41_file_info *createattrs,
56 OUT nfs41_file_info *info);
57
58 int nfs41_delegation_to_open(
59 IN nfs41_open_state *open,
60 IN bool_t try_recovery);
61
62 void nfs41_delegation_remove_srvopen(
63 IN nfs41_session *session,
64 IN nfs41_path_fh *file);
65
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,
71 #ifndef __REACTOS__
72 IN enum open_delegation_type4 access,
73 #else
74 IN int access,
75 #endif
76 IN bool_t truncate);
77 #else
78 static int nfs41_delegation_return(
79 IN nfs41_session *session,
80 IN nfs41_path_fh *file,
81 IN enum open_delegation_type4 access,
82 IN bool_t truncate)
83 {
84 return NFS4_OK;
85 }
86 #endif
87
88
89 /* asynchronous delegation recall */
90 int nfs41_delegation_recall(
91 IN nfs41_client *client,
92 IN nfs41_fh *fh,
93 IN const stateid4 *stateid,
94 IN bool_t truncate);
95
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);
101
102
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);
107
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);
112
113 #endif /* DELEGATION_H */