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