Whamcloud - gitweb
LUDOC 299 protocol: Spell-check document
[doc/protocol.git] / struct_mdt_rec_setattr.txt
1 REINT_SETATTR Structure
2 ^^^^^^^^^^^^^^^^^^^^^^^
3 [[struct-mdt-rec-setattr]]
4
5 The variant of the 'mdt_rec_reint' for the 'setattr' operation is:
6
7 [source,c]
8 ----
9 struct mdt_rec_setattr {
10         __u32           sa_opcode;
11         __u32           sa_cap;
12         __u32           sa_fsuid;
13         __u32           sa_fsuid_h;
14         __u32           sa_fsgid;
15         __u32           sa_fsgid_h;
16         __u32           sa_suppgid;
17         __u32           sa_suppgid_h;
18         __u32           sa_padding_1;
19         __u32           sa_padding_1_h;
20         struct lu_fid   sa_fid;
21         __u64           sa_valid;
22         __u32           sa_uid;
23         __u32           sa_gid;
24         __u64           sa_size;
25         __u64           sa_blocks;
26         obd_time        sa_mtime;
27         obd_time        sa_atime;
28         obd_time        sa_ctime;
29         __u32           sa_attr_flags;
30         __u32           sa_mode;
31         __u32           sa_bias;      /* some operation flags */
32         __u32           sa_padding_3;
33         __u32           sa_padding_4;
34         __u32           sa_padding_5;
35 };
36 ----
37
38 The 'setattr' variant modifies the semantics of the generic REINT
39 fields as follows:
40
41 There is only one FID to be operated upon, and the 'sa_valid',
42 'sa_uid', and 'sa_gid' values take the place of the second 'struct
43 lu_fid' in the generic 'mdt_rec_reint'. See also <<struct-lu-fid>>.
44
45 The 'sa_valid' field identifies which of the other fields in the
46 structure are to be honored. If the corresponding flag bit is not set
47 then the value of the corresponding field is to be ignored. The flags
48 are:
49
50 .SA Valid
51 ****
52 [source,c]
53 ----
54 #define MDS_ATTR_MODE          0x1ULL /* = 1 */
55 #define MDS_ATTR_UID           0x2ULL /* = 2 */
56 #define MDS_ATTR_GID           0x4ULL /* = 4 */
57 #define MDS_ATTR_SIZE          0x8ULL /* = 8 */
58 #define MDS_ATTR_ATIME        0x10ULL /* = 16 */
59 #define MDS_ATTR_MTIME        0x20ULL /* = 32 */
60 #define MDS_ATTR_CTIME        0x40ULL /* = 64 */
61 #define MDS_ATTR_ATIME_SET    0x80ULL /* = 128 */
62 #define MDS_ATTR_MTIME_SET   0x100ULL /* = 256 */
63 #define MDS_ATTR_FORCE       0x200ULL /* = 512 */
64 #define MDS_ATTR_ATTR_FLAG   0x400ULL /* = 1024 */
65 #define MDS_ATTR_KILL_SUID   0x800ULL /* = 2048 */
66 #define MDS_ATTR_KILL_SGID  0x1000ULL /* = 4096 */
67 #define MDS_ATTR_CTIME_SET  0x2000ULL /* = 8192 */
68 #define MDS_ATTR_FROM_OPEN  0x4000ULL /* = 16384 */
69 #define MDS_ATTR_BLOCKS     0x8000ULL /* = 32768 */
70 ----
71 ****
72
73 The 'sa_uid' and 'sa_gid' fields give the values of the UID and GID
74 attributes, respectively, to be set on the target resource.
75
76 There is no umask for the 'setattr' variant, and no high order bytes
77 for the flags attribute. Otherwise, the order of the attributes is
78 different in the structure, but their semantics remains the same as for
79 the generic case.
80
81