1 Command 101: LDLM ENQUEUE - Enqueue a lock request
2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 An RPC that implements distributed locking across the servers and
6 clients. In its simplest form it just exchanges 'ldlm_request' and
7 'ldlm_reply' descriptors of the desired and granted locks.
9 .LDLM_ENQUEUE Generic Packet Structure
10 image::ldlm-enqueue-generic.png["LDLM_ENQUEUE Generic Packet Structure",height=150]
12 //////////////////////////////////////////////////////////////////////
13 The ldlm-enqueue-generic.png diagram resembles this text
17 --request---------------------
18 | ptlrpc_body | ldlm_request |
19 ------------------------------
20 --reply---------------------
21 | ptlrpc_body | ldlm_reply |
22 ----------------------------
23 --extent lvb reply--------------------
24 | ptlrpc_body | ldlm_reply | ost_lvb |
25 --------------------------------------
26 //////////////////////////////////////////////////////////////////////
28 However, there are many variants to this RPCs. A lock request may signal
29 an intention to carry out an operation once a lock has been
30 granted. In the following example, the RPCs are fostering the 'intent'
31 to look at how a resource is mapped to the available targets, so
32 called 'layout' information.
34 .LDLM_ENQUEUE Intent:Layout Generic Packet Structure
35 image::ldlm-enqueue-intent-layout-generic.png["LDLM_ENQUEUE Intent:Layout Generic Packet Structure",height=100]
37 //////////////////////////////////////////////////////////////////////
38 The ldlm-enqueue-intent-layout-generic.png diagram resembles this text
42 --intent:layout request------------------------------------
43 | ptlrpc_body | ldlm_request |ldlm_intent | layout_intent |
45 -----------------------------------------------------------
46 --intent:layout reply--------------------
47 | ptlrpc_body | ldlm_reply | lov_mds_md |
48 -----------------------------------------
49 //////////////////////////////////////////////////////////////////////
55 Description of the lock being requested. Which resource is the target,
56 what lock is current, and what lock desired.
59 Description of the intent being included with the lock request.
62 Description of the layout information that is the subject of a layout
66 Resembling the 'ldlm_request', but in this case indicating what the
67 LDLM actually granted as well as relevant policy data.
70 A Lock Value Block (LVB) is included in the LDLM_ENQUEUE reply message
71 when one of three things needs to be communicated back to the
72 requester. The three alternatives are captured by the
73 'ost_lvb'structure, the 'lov_mds_md' structure, and one other related
74 to quotas (and not yet incorporated into this document). LDLM_ENQUEUE
75 reply RPCs may include a zero length instance of an LVB.
78 An LVB to communicate attribute data for an extent associated with a
79 resource on a lock. It is returned from an OST to a client requesting
83 An LVB to communicate layout data associated with a resource. It is
84 returned from an MDT to a client requesting a lock a lock with a
85 layout intent. In an intent request (as opposed to a reply and as yet
86 unimplemanted) it will modify the layout. It will not be included
87 (zero length) in requests in current releases.