1 RPC 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 However, there are many variants to this RPCs. A lock request may signal
10 an intention to carry out an operation once a lock has been
13 .LDLM_ENQUEUE Request Packet Structure
14 image::ldlm-enqueue-request.png["LDLM_ENQUEUE Request Packet Structure",height=75]
16 //////////////////////////////////////////////////////////////////////
17 The ldlm-enqueue-request.png diagram resembles this text
21 --request---------------------
22 | ptlrpc_body | ldlm_request |
23 ------------------------------
24 //////////////////////////////////////////////////////////////////////
27 RPC descriptor. See <<struct-ptlrpc-body>>.
29 include::struct_ldlm_request.txt[]
31 .LDLM_ENQUEUE Reply Packet Structure
32 image::ldlm-enqueue-reply.png["LDLM_ENQUEUE Reply Packet Structure",height=50]
34 //////////////////////////////////////////////////////////////////////
35 The ldlm-enqueue-reply.png diagram resembles this text
39 --reply---------------------
40 | ptlrpc_body | ldlm_reply |
41 ----------------------------
42 //////////////////////////////////////////////////////////////////////
45 RPC descriptor. See <<struct-ptlrpc-body>>.
47 include::struct_ldlm_reply.txt[]
50 In the following example, the RPCs are fostering the 'intent'
51 to look at how a resource is mapped to the available targets, so
52 called 'layout' information.
55 .LDLM_ENQUEUE Intent:Layout Request Packet Structure
56 image::ldlm-enqueue-intent-layout-request.png["LDLM_ENQUEUE Intent:Layout Request Packet Structure",height=50]
58 //////////////////////////////////////////////////////////////////////
59 The ldlm-enqueue-intent-layout-request.png diagram resembles this text
63 --intent:layout request------------------------------------
64 | ptlrpc_body | ldlm_request |ldlm_intent | layout_intent |
65 -----------------------------------------------------------
68 //////////////////////////////////////////////////////////////////////
71 RPC descriptor. See <<struct-ptlrpc-body>>.
74 The LDLM Request structure. See <<struct-ldlm-request>>.
76 include::struct_ldlm_intent.txt[]
78 include::struct_layout_intent.txt[]
80 include::struct_lov_mds_md.txt[]
82 .LDLM_ENQUEUE Intent:Layout Reply Packet Structure
83 image::ldlm-enqueue-intent-layout-reply.png["LDLM_ENQUEUE Intent:Layout Reply Packet Structure",height=50]
85 //////////////////////////////////////////////////////////////////////
86 The ldlm-enqueue-intent-layout-reply.png diagram resembles this text
90 --intent:layout reply--------------------
91 | ptlrpc_body | ldlm_reply | lov_mds_md |
92 -----------------------------------------
93 //////////////////////////////////////////////////////////////////////
96 RPC descriptor. See <<struct-ptlrpc-body>>.
99 The LDLM Reply structure. See <<struct-ldlm-reply>>.
103 A Lock Value Block (LVB) is included in the LDLM_ENQUEUE reply message
104 when one of three things needs to be communicated back to the
105 requester. The three alternatives are captured by the
106 'ost_lvb' structure, the 'lov_mds_md' structure, and one other related
107 to quotas (and not yet incorporated into this document). LDLM_ENQUEUE
108 reply RPCs may include a zero length instance of an LVB.
112 The LOV MDS MD structure. See <<struct-lov-mds-md>>.
114 And in this example the intent is to get attribute information.
116 .LDLM_ENQUEUE Intent:Getattr Request Packet Structure
117 image::ldlm-enqueue-intent-getattr-request.png["LDLM_ENQUEUE Intent:Getattr Request Packet Structure",height=50]
119 //////////////////////////////////////////////////////////////////////
120 The ldlm-enqueue-intent-getattr-request.png diagram resembles this text
124 --intent:getattr request-------------------------------
125 | ptlrpc_body | ldlm_request | ldlm_intent | mdt_body |
126 -------------------------------------------------------
127 | lustre_capa | name |
128 ----------------------
129 //////////////////////////////////////////////////////////////////////
132 RPC descriptor. See <<struct-ptlrpc-body>>.
135 The LDLM Request structure. See <<struct-ldlm-request>>.
138 The LDLM Intent structure. See <<struct-ldlm-intent>>.
141 Metadata about the resource. See <<struct-mdt-body>>.
144 A "capabilities" structure. See <<struct-lustre-capa>>.
147 A text field supplying the name of the desired resource.
149 .LDLM_ENQUEUE Intent:Getattr Reply Packet Structure
150 image::ldlm-enqueue-intent-getattr-reply.png["LDLM_ENQUEUE Intent:Getattr Reply Packet Structure",height=50]
152 //////////////////////////////////////////////////////////////////////
153 The ldlm-enqueue-intent-getattr-reply.png diagram resembles this text
157 --intent:getattr reply--------------------------
158 | ptlrpc_body | ldlm_reply | mdt_body | mdt_md |
159 ------------------------------------------------
160 //////////////////////////////////////////////////////////////////////
163 RPC descriptor. See <<struct-ptlrpc-body>>.
166 The LDLM Reply structure. See <<struct-ldlm-reply>>.
169 Metadata about the resource. See <<struct-mdt-body>>.
172 Layout data for the resource. This buffer is optional and will appear
173 as zero length in some packets.
175 .LDLM_ENQUEUE Intent:Lvb Reply Packet Structure
176 image::ldlm-enqueue-intent-lvb-reply.png["LDLM_ENQUEUE Intent:Lvb Reply Packet Structure",height=50]
178 //////////////////////////////////////////////////////////////////////
179 The ldlm-enqueue-intent-lvb-reply.png diagram resembles this text
183 --intent:lvb reply--------------------
184 | ptlrpc_body | ldlm_reply | ost_lvb |
185 --------------------------------------
186 //////////////////////////////////////////////////////////////////////
189 RPC descriptor. See <<struct-ptlrpc-body>>.
192 The LDLM Reply structure. See <<struct-ldlm-reply>>.
194 include::struct_ost_lvb.txt[]
196 Here is another example of an intent, in this case the 'getxattr' intent.
198 .LDLM_ENQUEUE Intent:Getxattr Request Packet Structure
199 image::ldlm-enqueue-intent-getxattr-request.png["LDLM_ENQUEUE Intent:Getxattr Request Packet Structure",height=50]
201 //////////////////////////////////////////////////////////////////////
202 The ldlm-enqueue-intent-getxattr-request.png diagram resembles this text
206 --intent:getxattr request-----------------------------
207 | ptlrpc_body | ldlm_request |ldlm_intent | mdt_body |
208 ------------------------------------------------------
211 //////////////////////////////////////////////////////////////////////
214 RPC descriptor. See <<struct-ptlrpc-body>>.
217 The LDLM Request structure. See <<struct-ldlm-request>>.
220 The LDLM Intent structure. See <<struct-ldlm-intent>>.
223 Metadata about the resource. See <<struct-mdt-body>>.
226 A "capabilities" structure. See <<struct-lustre-capa>>.
228 .LDLM_ENQUEUE Intent:Getxattr Reply Packet Structure
229 image::ldlm-enqueue-intent-getxattr-reply.png["LDLM_ENQUEUE Intent:Getxattr Reply Packet Structure",height=50]
231 //////////////////////////////////////////////////////////////////////
232 The ldlm-enqueue-intent-getxattr-reply.png diagram resembles this text
236 --intent:getxattr reply----------------------------------------
237 | ptlrpc_body | ldlm_reply | mdt_body | lov_mds_md | ACL data |
238 | EA data | EA vals | EA lens |
239 ---------------------------------------------------------------
240 //////////////////////////////////////////////////////////////////////
243 RPC descriptor. See <<struct-ptlrpc-body>>.
246 The LDLM Reply structure. See <<struct-ldlm-reply>>.
249 Metadata about the resource. See <<struct-mdt-body>>.
252 The LOV MDS MD structure. See <<struct-lov-mds-md>>.
255 Access Control List data associated with a resource.
258 The names of any extended attributes associated with the resource. The
259 names are null-terminated strings concatenated into a single sequnce.
262 A block of data concatenating the values for the extended attributes
266 The sizes of the extended attirbute values. This is a sequence of
267 32-bit unsigned integers, one for each extended
268 attribute. The sizes give the length of the corresponding extended
269 attribute in the "EA vals" block of data. Thus the sum of those sizes
270 equals the length of the "EA vals".