Whamcloud - gitweb
57eae8f6075b8bfaf142666427df70a3592df6b0
[doc/protocol.git] / mds_reint.txt
1 RPC 36: MDS_REINT
2 ~~~~~~~~~~~~~~~~~
3 [[mds-reint-rpc]]
4
5 An MDS_REINT RPC ('pb_opc' = 36) is one that implements an operation
6 that will change the state of an object on an MDT. There are a variety
7 of operations all gathered under the MDS_REINT 'opcode'. The possible
8 values for the 'mdt_rec_reint' struct's 'rr_opcode' field give types
9 of operations that are encoded as MDS_REINT RPCs:
10
11 .MDS Reint Opcodes ('rr_opcode')
12 ****
13 [source,c]
14 ----
15 typedef enum {
16         REINT_SETATTR  = 1,
17         REINT_CREATE   = 2,
18         REINT_LINK     = 3,
19         REINT_UNLINK   = 4,
20         REINT_RENAME   = 5,
21         REINT_OPEN     = 6,
22         REINT_SETXATTR = 7,
23         REINT_RMENTRY  = 8,
24         REINT_MIGRATE  = 9
25 };
26 ----
27 ****
28
29 include::struct_mdt_rec_reint.txt[]
30
31 REINT_SETATTR RPC
32 ^^^^^^^^^^^^^^^^^
33 [[mds-reint-setattr-rpc]]
34
35 The REINT_SETATTR is an RPC that implements the 'setattr' sub-command
36 of the MDS_REINT.
37
38 .MDS_REINT:REINT_SETATTR Request Packet Structure
39 image::mds-reint-setattr-request.png["MDS_REINT:REINT_SETATTR Request Packet Structure",height=75]
40
41 //////////////////////////////////////////////////////////////////////
42 The mds-reint-setattr-request.png diagram resembles this text art:
43
44         MDS_REINT:
45       --REINT_SETATTR-request-------------------------------------
46       | ptlrpc_body | mdt_rec_setattr | lustre_capa | mdt_ioepoc |
47       ------------------------------------------------------------
48       | eadata | llog_cookie | ldlm_request |
49       ---------------------------------------
50 //////////////////////////////////////////////////////////////////////
51
52 'ptlrpc_body'::
53 RPC descriptor. See <<struct-ptlrpc-body>>.
54
55 include::struct_mdt_rec_setattr.txt[]
56
57 After the 'mdt_rec_setattr' there are several more buffers defined for
58 the RPC, but those before the 'ldlm_request' are often unused and
59 appear as zero-length buffers in the header.
60
61 'lustre_capa'::
62 A "capabilities" structure. See <<struct-lustre-capa>>.
63
64 'mdt_ioepoch'::
65 Identifying "epoch" information. This buffer is optional and will
66 appear as zero length in some packets.
67
68 'eadata'::
69 Information about extended attributes. This buffer is optional and will
70 appear as zero length in some packets.
71
72 'llog_cookie'::
73 A log handle.  This buffer is optional and will appear as zero length
74 in some packets.
75
76 'ldlm_request'::
77 A structure specifying a lock that can be the subject of early lock
78 cancellation. See <<early-lock-cancellation>>.
79
80 .MDS_REINT:REINT_SETATTR Reply Packet Structure
81 image::mds-reint-setattr-reply.png["MDS_REINT:REINT_SETATTR Reply Packet Structure",height=50]
82
83 //////////////////////////////////////////////////////////////////////
84 The mds-reint-setattr-reply.png diagram resembles this text art:
85
86         MDS_REINT:
87       --REINT_SETATTR-reply--------------------------------
88       | ptlrpc_body | mdt_body | mdt_md | acl | fid1_capa |
89       -----------------------------------------------------
90       | fid2_capa |
91       -------------
92 //////////////////////////////////////////////////////////////////////
93
94 'ptlrpc_body'::
95 RPC descriptor. See <<struct-ptlrpc-body>>.
96
97 'mdt_body'::
98 Metadata about the resource.
99
100 'mdt_md'::
101 Layout data for the resource. This buffer is optional and will appear
102 as zero length in some packets. This needs to be further explained.
103
104 'acl'::
105 Access control list data. This buffer is optional and will appear as
106 zero length in some packets.
107
108 'fid1_capa'::
109 The capabilities structure for the first FID in the 'mdt_body'. See
110 <<struct-lustre-capa>>.
111
112 'fid2_capa'::
113 The capabilities structure for the second FID in the 'mdt_body'. See
114 <<struct-lustre-capa>>.
115
116 REINT_SETXATTR RPC
117 ^^^^^^^^^^^^^^^^^^
118 [[mds-reint-setxattr-rpc]]
119
120 An RPC that implements the 'setxattr' sub-command of the MDS_REINT.
121
122 .MDS_REINT:REINT_SETXATTR Request Packet Structure
123 image::mds-reint-setxattr-request.png["MDS_REINT:REINT_SETXATTR Request Packet Structure",height=75]
124
125 //////////////////////////////////////////////////////////////////////
126 The mds-reint-setxattr-request.png diagram resembles this text art:
127
128         MDS_REINT:
129       --REINT_SETXATTR-request-------------------------------------
130       | ptlrpc_body | mdt_rec_setxattr | lustre_capa | mdt_ioepoc |
131       -------------------------------------------------------------
132       | eadata | llog_cookie | ldlm_request |
133       ---------------------------------------
134 //////////////////////////////////////////////////////////////////////
135
136 'ptlrpc_body'::
137 RPC descriptor. See <<struct-ptlrpc-body>>.
138
139 include::struct_mdt_rec_setxattr.txt[]
140
141 Retruning to the remaining buffers in the REINT_SETXATTR RPC we again
142 have several optional buffers followed by the 'ldlm_request'.
143
144 'lustre_capa'::
145 A "capabilities" structure. See <<struct-lustre-capa>>. This buffer is
146 optional and will appear as zero length in some packets.
147
148 'mdt_ioepoch'::
149 Identifying "epoch" information. This buffer is optional and will
150 appear as zero length in some packets.
151
152 'eadata'::
153 Information about extended attributes. This buffer is optional and will
154 appear as zero length in some packets.
155
156 'llog_cookie'::
157 A log handle.  This buffer is optional and will appear as zero length
158 in some packets.
159
160 'ldlm_request'::
161 A structure specifying a lock that can be the subject of early lock
162 cancellation. See <<early-lock-cancellation>>.
163
164 .MDS_REINT:REINT_SETXATTR Reply Packet Structure
165 image::mds-reint-setxattr-reply.png["MDS_REINT:REINT_SETXATTR Reply Packet Structure",height=50]
166
167 //////////////////////////////////////////////////////////////////////
168 The mds-reint-setxattr-reply.png diagram resembles this text art:
169
170         MDS_REINT:
171       --REINT_SETXATTR-reply---------------------------------
172       | ptlrpc_body | mdt_body | mdt_md | acl | fid1_capa |
173       -------------------------------------------------------
174       | fid2_capa |
175       -------------
176 //////////////////////////////////////////////////////////////////////
177
178 'ptlrpc_body'::
179 RPC descriptor. See <<struct-ptlrpc-body>>.
180
181 'mdt_body'::
182 Metadata about the resource.
183
184 'mdt_md'::
185 Layout data for the resource. This buffer is optional and will appear
186 as zero length in some packets.
187
188 'acl'::
189 Access control list data. This buffer is optional and will appear as
190 zero length in some packets.
191
192 'fid1_capa'::
193 The capabilities structure for the first FID in the 'mdt_body'. See
194 <<struct-lustre-capa>>.
195
196 'fid2_capa'::
197 The capabilities structure for the second FID in the 'mdt_body'. See
198 <<struct-lustre-capa>>.
199