Whamcloud - gitweb
LUDOC 299 protocol: Spell-check document
[doc/protocol.git] / struct_mdt_body.txt
1 MDT Body
2 ^^^^^^^^
3 [[struct-mdt-body]]
4
5 An 'mdt_body' structure conveys information about the metadata for a
6 single resource, typically an MDT inode.
7
8 [source,c]
9 ----
10 struct mdt_body {
11         struct lu_fid mbo_fid1; /* OBD_MD_FLID */
12         struct lu_fid mbo_fid2; /* OBD_MD_FLID */
13         struct lustre_handle mbo_handle;
14         __u64   mbo_valid;
15         __u64   mbo_size; /* OBD_MD_FLSIZE */
16         __s64   mbo_mtime; /* OBD_MD_FLATIME */
17         __s64   mbo_atime; /* OBD_MD_FLMTIME */
18         __s64   mbo_ctime; /* OBD_MD_FLCTIME */
19         __u64   mbo_blocks; /* OBD_MD_FLBLOCKS */
20         __u64   mbo_ioepoch;
21         __u64   mbo_t_state; /* OBD_MD_TSTATE */
22         __u32   mbo_fsuid;
23         __u32   mbo_fsgid;
24         __u32   mbo_capability;
25         __u32   mbo_mode; /* OBD_MD_FLMODE */
26         __u32   mbo_uid; /* OBD_MD_FLUID */
27         __u32   mbo_gid; /* OBD_MD_FLGID */
28         __u32   mbo_flags; /* OBD_MD_FLFLAGS */
29         __u32   mbo_rdev; /* OBD_MD_FLRDEV */
30         __u32   mbo_nlink; /* OBD_MD_FLNLINK */
31         __u32   mbo_unused2;
32         __u32   mbo_suppgid;
33         __u32   mbo_eadatasize; /* OBD_MD_FLEASIZE */
34         __u32   mbo_aclsize; /* OBD_MD_FLACL */
35         __u32   mbo_max_mdsize; /* OBD_MD_FLMODEASIZE */
36         __u32   mbo_max_cookiesize; /* OBD_MD_FLMODEASIZE */
37         __u32   mbo_uid_h;
38         __u32   mbo_gid_h;
39         __u32   mbo_padding_5;
40         __u64   mbo_padding_6;
41         __u64   mbo_padding_7;
42         __u64   mbo_padding_8;
43         __u64   mbo_padding_9;
44         __u64   mbo_padding_10;
45 }; /* 216 */
46 ----
47
48 For an operation that involves two resources both the 'mbo_fid1' and
49 'mbo_fid2' fields will be filled in. If the 'mdt_body' is part of an
50 RPC affecting or involving only a single resource then 'mbo_fid1' will
51 designate that resource and 'mbo_fid2' will be cleared.
52
53 include::struct_lu_fid.txt[]
54
55 *Returning to the 'mdt_body' structure the remaining fields are as
56 follows.*
57
58 The 'mbo_handle' field indicates the identity of the previously
59 acquired lock for an open file, if any, that is the subject of the
60 operation. If there is no lock then it is just 0.
61
62 The 'mbo_valid' field identifies which of the remaining fields are
63 actually in force. The flags in 'mbo_valid' are:
64
65 [source,c]
66 ----
67 #define OBD_MD_FLID        (0x00000001ULL)
68 #define OBD_MD_FLATIME     (0x00000002ULL)
69 #define OBD_MD_FLMTIME     (0x00000004ULL)
70 #define OBD_MD_FLCTIME     (0x00000008ULL)
71 #define OBD_MD_FLSIZE      (0x00000010ULL)
72 #define OBD_MD_FLBLOCKS    (0x00000020ULL)
73 #define OBD_MD_FLMODE      (0x00000080ULL)
74 #define OBD_MD_FLUID       (0x00000200ULL)
75 #define OBD_MD_FLGID       (0x00000400ULL)
76 #define OBD_MD_FLFLAGS     (0x00000800ULL)
77 #define OBD_MD_FLNLINK     (0x00002000ULL)
78 #define OBD_MD_FLRDEV      (0x00010000ULL)
79 #define OBD_MD_FLEASIZE    (0x00020000ULL)
80 #define OBD_MD_FLMODEASIZE (0x80000000ULL)
81 #define OBD_MD_TSTATE      (0x0000000800000000ULL)
82 #define OBD_MD_FLACL       (0x0000008000000000ULL)
83 ----
84
85 Which flag is associated with which field is indicated in the comments
86 beside the fields in the struct definition above. The fields without
87 corresponding flags in the 'mbo_valid' field are also 'valid'.
88
89 Many of the fields have names and meanings that correspond directly to
90 those in 'struct mdt_rec_setattr' (ex. 'atime', 'size', 'mode',
91 etc). Mainly these are the conventional metadata attributes, and
92 should be self-explanatory. The ones that are a little less obvious are
93 discussed here.
94
95 The 'mbo_ioepoch' field is no longer in use.
96
97 The 'mbo_t_state' field indicates if there is a "transient state", as
98 when an HSM "restore" is in operation.
99
100 The 'mbo_rdev' field holds the special device number for a block or
101 character device associated with the resource, if there is one. It will
102 be 0 for a regular file.
103
104 The 'mbo_nlink' field gives the number of hard links to the resource.
105
106 The 'mbo_eadatasize' field gives the size of the extended attributes,
107 which hold such information as the resource's layout.
108
109 The 'mbo_aclsize' field indicates the size of the POSIX access control
110 lists (ACLs) in bytes.
111
112 The 'mbo_max_mdsize' field indicates the maximum size of the file layout,
113 as described in <<struct-lov-mds-md>>
114
115 The 'mbo_max_cookiesize' field is unused since Lustre 2.4.  It
116 formerly held the maximum permissible size of llog cookies for
117 destroyed OST objects.