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