Whamcloud - gitweb
LUDOC-293 protocol: Merge all recent patches
[doc/protocol.git] / mdt_rec_reint.txt
1 Generic MDS_REINT
2 ^^^^^^^^^^^^^^^^^
3
4 An 'mdt_rec_reint' structure specifies the generic form for MDS_REINT
5 requests. Each sub-operation, as defned by the 'rr_opcode' field, has
6 its own variant of this structure. Each variant has the same size as
7 the generic 'mdt_rec_reint', but interprets its fields slightly
8 differently.  Note that in order for swabbing to take place correctly
9 the sequence of field sizes must the same in every variant as it is in
10 the generic version (not just the overal size of the sturcture).
11
12 ----
13 struct mdt_rec_reint {
14         __u32           rr_opcode;
15         __u32           rr_cap;
16         __u32           rr_fsuid;
17         __u32           rr_fsuid_h;
18         __u32           rr_fsgid;
19         __u32           rr_fsgid_h;
20         __u32           rr_suppgid1;
21         __u32           rr_suppgid1_h;
22         __u32           rr_suppgid2;
23         __u32           rr_suppgid2_h;
24         struct lu_fid   rr_fid1;
25         struct lu_fid   rr_fid2;
26         obd_time        rr_mtime;
27         obd_time        rr_atime;
28         obd_time        rr_ctime;
29         __u64           rr_size;
30         __u64           rr_blocks;
31         __u32           rr_bias;
32         __u32           rr_mode;
33         __u32           rr_flags;
34         __u32           rr_flags_h;
35         __u32           rr_umask;
36         __u32           rr_padding_4; /* also fix lustre_swab_mdt_rec_reint */
37 };
38 ----
39
40 The 'rr_opcode' field defines one among the several sub-commands for
41 MDS REINT RPCs. Those opcodes are:
42
43 ----
44 typedef enum {
45   REINT_SETATTR  = 1,
46   REINT_CREATE   = 2,
47   REINT_LINK     = 3,
48   REINT_UNLINK   = 4,
49   REINT_RENAME   = 5,
50   REINT_OPEN     = 6,
51   REINT_SETXATTR = 7,
52 } mds_reint_t;
53 ----
54
55 Based on that opcode one of the variants of the structure will
56 actually be used. See <<mds-reint-setattr-rpc>> for one example.
57
58 The 'rr_cap' field is not used (and has been dropped in more recent
59 code updates).
60
61 The 'rr_fsuid' field gives the UID of the file system mount point.
62
63 The 'rr_fsuid_h' field gives the high bytes of a the file system mount
64 point UID in an environment where UIDs are 64-bit. The same holds for
65 the other '_h' fields.
66
67 The 'rr_fsgid' field gives the GID of the file system mount point.
68 For each opcode there is a variant of the 'mdt_rec_reint' that has
69 identical byte fields, but slightly modified semantics. The following
70 is for the REINT_SETATTR sub-operation.
71
72 The 'rr_suppgid1' and 'rr_suppgid2' fields are supplementary GID
73 information for kernels that have it.
74
75 The 'rr_fid1' and 'rr_fid2' fields specify the file IDs for the
76 resources being operated upon. If only one resource is being acted
77 upon then 'rr_fid2' is not used.
78
79 The 'rr_mtime' 'rr_atime' and 'rr_ctime' fields give the values of the
80 time attributes. The 'obd_time' type is also a '__u64'.
81
82 The 'rr_size' field gives the value of the size attribute.
83
84 The 'rr_blocks' field gives the value of the number-of-blocks
85 attribute.
86
87 The 'rr_bias' field adds additional optional information to the
88 REINT. The possible values are:
89
90 ----
91 enum mds_op_bias {
92         MDS_CHECK_SPLIT         = 1 << 0,
93         MDS_CROSS_REF           = 1 << 1,
94         MDS_VTX_BYPASS          = 1 << 2,
95         MDS_PERM_BYPASS         = 1 << 3,
96         MDS_SOM                 = 1 << 4,
97         MDS_QUOTA_IGNORE        = 1 << 5,
98         MDS_KEEP_ORPHAN         = 1 << 7,
99         MDS_RECOV_OPEN          = 1 << 8,
100         MDS_DATA_MODIFIED       = 1 << 9,
101         MDS_CREATE_VOLATILE     = 1 << 10,
102         MDS_OWNEROVERRIDE       = 1 << 11,
103         MDS_HSM_RELEASE         = 1 << 12,
104 };
105 ----
106
107 For example, MDS_DATA_MODIFIED signals to the HSM system that the MDT
108 should set the corresponding HSM extended attribute. We'll return to
109 this topic with more details about the individual flags at a later
110 date.
111
112 The 'rr_mode' field gives the value of the mode attribute.
113
114 The 'rr_flags' and 'rr_flags_h' fields give the value (and the high
115 order bytes of the value, respectively, if there are high order bytes)
116 of the flags attribute.
117
118 The 'rr_umask' gives the value of the 'umask' to apply in, for
119 example, a REINT_CREATE.