3 [[struct-ldlm-lock-desc]]
5 The lock descriptor conveys the specific details about a particular
6 lock being requested or granted. It appears in
7 <<struct-ldlm-request>>.
10 struct ldlm_lock_desc {
11 struct ldlm_resource_desc l_resource;
12 ldlm_mode_t l_req_mode;
13 ldlm_mode_t l_granted_mode;
14 ldlm_wire_policy_data_t l_policy_data;
18 The 'l_resource' field identifies the resource upon which the lock is
19 being requested or granted. See the description of
20 <<struct-ldlm-resource-desc>>.
22 The 'l_req_mode' and 'l_granted_mode' fields give the kind of lock
23 being requested and the kind of lock that has been granted. The field
28 LCK_EX = 1, /* exclusive */
29 LCK_PW = 2, /* privileged write */
30 LCK_PR = 4, /* privileged read */
31 LCK_CW = 8, /* concurrent write */
32 LCK_CR = 16, /* concurrent read */
39 Despite the fact that the lock modes are not overlapping, these lock
40 modes are exclusive. In addition the mode value 0 is the MINMODE,
43 In a request 'l_req_mode' is the value actually being requested and
44 'l_granted_mode' is the value that currently is in place on for the
45 requester. In a reply the 'l_req_mode' may be modified if more or
46 fewer privileges were granted than requested, and the
47 'l_granted_mode' is what has, in fact, been granted.
49 The 'l_policy_data' field gives the kind of resource being
50 requested/granted. It is a union of these struct definitions:
51 [[ldlm-wire-policy-data-t]]
55 struct ldlm_extent l_extent;
56 struct ldlm_flock_wire l_flock;
57 struct ldlm_inodebits l_inodebits;
58 } ldlm_wire_policy_data_t;
67 struct ldlm_flock_wire {
74 struct ldlm_inodebits {
79 Thus the lock may be on an 'extent', a contiguous sequence of bytes
80 in a regular file; an 'flock wire', whatever to heck that is; or a
81 portion of an inode. For a "plain" lock (or one with no type at all)
82 the 'l_policy_data' field has zero length.