Whamcloud - gitweb
LU-2062 utils: HSM Posix CopyTool
[fs/lustre-release.git] / contrib / bit-masks / lustre_dlm_flags.def
1 AutoGen Definitions lustre_dlm_flags.tpl;
2
3 flag[ 0] = {
4     f-name  = lock_changed;
5     f-mask  = on_wire;
6     f-desc  = 'extent, mode, or resource changed';
7 };
8
9 flag[ 1] = {
10     f-name  = block_granted;
11     f-mask  = on_wire, blocked;
12     f-desc  = 'Server placed lock on granted list, or a recovering client wants '
13               'the lock added to the granted list, no questions asked.';
14 };
15
16 flag[ 2] = {
17     f-name  = block_conv;
18     f-mask  = on_wire, blocked;
19     f-desc  = <<- _EOF_
20         Server placed lock on conv list, or a recovering client wants the lock
21         added to the conv list, no questions asked.
22         _EOF_;
23 };
24
25 flag[ 3] = {
26     f-name  = block_wait;
27     f-mask  = on_wire, blocked;
28     f-desc  = <<- _EOF_
29         Server placed lock on wait list, or a recovering client wants
30         the lock added to the wait list, no questions asked.
31         _EOF_;
32 };
33
34 // Skipped bit 4
35
36 flag[ 5] = {
37     f-name  = ast_sent;
38     f-mask  = on_wire;
39     f-desc  = 'blocking or cancel packet was queued for sending.';
40 };
41
42 // Skipped bits 6 and 7
43
44 flag[ 8] = {
45     f-name  = replay;
46     f-mask  = on_wire;
47     f-desc  = <<- _EOF_
48         Lock is being replayed.  This could probably be implied by the fact that
49         one of BLOCK_{GRANTED,CONV,WAIT} is set, but that is pretty dangerous.
50         _EOF_;
51 };
52
53 flag[ 9] = {
54     f-name  = intent_only;
55     f-mask  = on_wire;
56     f-desc  = "Don't grant lock, just do intent.";
57 };
58
59 // Skipped bits 10 and 11
60
61 flag[12] = {
62     f-name  = has_intent;
63     f-mask  = on_wire;
64     f-desc  = 'lock request has intent';
65 };
66
67 // Skipped bits 13, 14 and 15
68
69 flag[16] = {
70     f-name  = discard_data;
71     f-mask  = on_wire;
72     f-desc  = 'discard (no writeback) on cancel';
73 };
74
75 flag[17] = {
76     f-name  = no_timeout;
77     f-mask  = on_wire;
78     f-desc  = 'Blocked by group lock - wait indefinitely';
79 };
80
81 flag[18] = {
82     f-name  = block_nowait;
83     f-mask  = on_wire;
84     f-desc  = <<- _EOF_
85         Server told not to wait if blocked. For AGL, OST will not send
86         glimpse callback.
87         _EOF_;
88 };
89
90 flag[19] = {
91     f-name  = test_lock;
92     f-mask  = on_wire;
93     f-desc  = 'return blocking lock';
94 };
95
96 // Skipped bits 20, 21, and 22
97
98 flag[23] = {
99     f-name  = cancel_on_block;
100     f-mask  = on_wire, inherit;
101     f-desc  = <<- _EOF_
102         Immediatelly cancel such locks when they block some other locks. Send
103         cancel notification to original lock holder, but expect no reply. This is
104         for clients (like liblustre) that cannot be expected to reliably response
105         to blocking AST.
106         _EOF_;
107 };
108
109 // Skipped bits 24 through 29
110
111 flag[30] = {
112     f-name  = deny_on_contention;
113     f-mask  = on_wire;
114     f-desc  = 'measure lock contention and return -EUSERS if locking contention '
115               'is high';
116 };
117
118 flag[31] = {
119     f-name  = ast_discard_data;
120     f-mask  = on_wire, ast;
121     f-desc  = <<- _EOF_
122         These are flags that are mapped into the flags and ASTs of blocking locks
123         Add FL_DISCARD to blocking ASTs
124         _EOF_;
125 };
126
127 flag[32] = {
128     f-name  = fail_loc;
129     f-mask  = local_only;
130     f-desc  = <<- _EOF_
131         Used for marking lock as a target for -EINTR while cp_ast sleep
132         emulation + race with upcoming bl_ast.
133         _EOF_;
134 };
135
136 flag[33] = {
137     f-name  = skipped;
138     f-mask  = local_only;
139     f-desc  = <<- _EOF_
140         Used while processing the unused list to know that we have already
141         handled this lock and decided to skip it.
142         _EOF_;
143 };
144
145
146 flag[34] = {
147     f-name  = cbpending;
148     f-mask  = local_only, hide_lock;
149     f-desc  = 'this lock is being destroyed';
150 };
151
152 flag[35] = {
153     f-name  = wait_noreproc;
154     f-mask  = local_only;
155     f-desc  = 'not a real flag, not saved in lock';
156 };
157
158 flag[36] = {
159     f-name  = cancel;
160     f-mask  = local_only;
161     f-desc  = 'cancellation callback already run';
162 };
163
164 flag[37] = {
165     f-name  = local_only;
166     f-mask  = local_only, hide_lock;
167     f-desc  = 'whatever it might mean';
168 };
169
170 flag[38] = {
171     f-name  = failed;
172     f-mask  = local_only, gone, hide_lock;
173     f-desc  = "don't run the cancel callback under ldlm_cli_cancel_unused";
174 };
175
176 flag[39] = {
177     f-name  = canceling;
178     f-mask  = local_only;
179     f-desc  = 'lock cancel has already been sent';
180 };
181
182 flag[40] = {
183     f-name  = local;
184     f-mask  = local_only;
185     f-desc  = 'local lock (ie, no srv/cli split)';
186 };
187
188 flag[41] = {
189     f-name  = lvb_ready;
190     f-mask  = local_only;
191     f-desc  = <<- _EOF_
192         XXX FIXME: This is being added to b_size as a low-risk fix to the
193         fact that the LVB filling happens _after_ the lock has been granted,
194         so another thread can match it before the LVB has been updated.  As
195         a dirty hack, we set LDLM_FL_LVB_READY only after we've done the LVB
196         poop.  this is only needed on LOV/OSC now, where LVB is actually
197         used and callers must set it in input flags.
198
199         The proper fix is to do the granting inside of the completion AST,
200         which can be replaced with a LVB-aware wrapping function for OSC
201         locks.  That change is pretty high-risk, though, and would need a
202         lot more testing.
203         _EOF_;
204 };
205
206 flag[42] = {
207     f-name  = kms_ignore;
208     f-mask  = local_only;
209     f-desc  = <<- _EOF_
210         A lock contributes to the known minimum size (KMS) calculation until
211         it has finished the part of its cancelation that performs write back
212         on its dirty pages.  It can remain on the granted list during this
213         whole time.  Threads racing to update the KMS after performing their
214         writeback need to know to exclude each other's locks from the
215         calculation as they walk the granted list.
216         _EOF_;
217 };
218
219 flag[43] = {
220     f-name  = cp_reqd;
221     f-mask  = local_only;
222     f-desc  = 'completion AST to be executed';
223 };
224
225 flag[44] = {
226     f-name  = cleaned;
227     f-mask  = local_only;
228     f-desc  = 'cleanup_resource has already handled the lock';
229 };
230
231 flag[45] = {
232     f-name  = atomic_cb;
233     f-mask  = local_only, hide_lock;
234     f-desc  = <<- _EOF_
235         optimization hint: LDLM can run blocking callback from current context
236         w/o involving separate thread. in order to decrease cs rate
237         _EOF_;
238 };
239
240 flag[46] = {
241     f-name  = bl_ast;
242     f-mask  = local_only;
243     f-desc  = <<- _EOF_
244         It may happen that a client initiates two operations, e.g. unlink
245         and mkdir, such that the server sends a blocking AST for conflicting
246         locks to this client for the first operation, whereas the second
247         operation has canceled this lock and is waiting for rpc_lock which
248         is taken by the first operation. LDLM_FL_BL_AST is set by
249         ldlm_callback_handler() in the lock to prevent the Early Lock Cancel
250         (ELC) code from cancelling it.
251
252         LDLM_FL_BL_DONE is to be set by ldlm_cancel_callback() when lock
253         cache is dropped to let ldlm_callback_handler() return EINVAL to the
254         server. It is used when ELC RPC is already prepared and is waiting
255         for rpc_lock, too late to send a separate CANCEL RPC.
256         _EOF_;
257 };
258
259 flag[47] = {
260     f-name  = bl_done;
261     f-mask  = local_only;
262     f-desc  = 'whatever it might mean';
263 };
264
265 flag[48] = {
266     f-name  = no_lru;
267     f-mask  = local_only;
268     f-desc  = <<- _EOF_
269         Don't put lock into the LRU list, so that it is not canceled due to
270         aging.  Used by MGC locks, they are cancelled only at unmount or by
271         callback.
272         _EOF_;
273 };
274
275 flag[49] = {
276     f-name  = fail_notified;
277     f-mask  = local_only, gone;
278     f-desc  = <<- _EOF_
279         Set for locks that failed and where the server has been notified.
280
281         Protected by lock and resource locks.
282         _EOF_;
283 };
284
285 flag[50] = {
286     f-name  = destroyed;
287     f-mask  = local_only, gone;
288     f-desc  = <<- _EOF_
289         Set for locks that were removed from class hash table and will be
290         destroyed when last reference to them is released. Set by
291         ldlm_lock_destroy_internal().
292
293         Protected by lock and resource locks.
294         _EOF_;
295 };
296
297 flag[51] = {
298     f-name  = server_lock;
299     f-mask  = local_only;
300     f-desc  = 'flag whether this is a server namespace lock';
301 };
302
303 flag[52] = {
304     f-name  = res_locked;
305     f-mask  = local_only;
306     f-desc  = <<- _EOF_
307         It's set in lock_res_and_lock() and unset in unlock_res_and_lock().
308
309         NB: compared with check_res_locked(), checking this bit is cheaper.
310         Also, spin_is_locked() is deprecated for kernel code; one reason is
311         because it works only for SMP so user needs to add extra macros like
312         LASSERT_SPIN_LOCKED for uniprocessor kernels.
313         _EOF_;
314 };
315
316 flag[53] = {
317     f-name  = waited;
318     f-mask  = local_only;
319     f-desc  = <<- _EOF_
320         It's set once we call ldlm_add_waiting_lock_res_locked()
321         to start the lock-timeout timer and it will never be reset.
322
323         Protected by lock and resource locks.
324         _EOF_;
325 };
326
327 flag[54] = {
328     f-name  = ns_srv;
329     f-mask  = local_only;
330     f-desc  = 'Flag whether this is a server namespace lock.';
331 };
332
333 flag[55] = {
334     f-name  = excl;
335     f-mask  = local_only;
336     f-desc  = 'Flag whether this lock can be reused. Used by exclusive open.';
337 };