REINT_SETATTR Structure ^^^^^^^^^^^^^^^^^^^^^^^ [[struct-mdt-rec-setattr]] The variant of the 'mdt_rec_reint' for the 'setattr' operation is: [source,c] ---- struct mdt_rec_setattr { __u32 sa_opcode; __u32 sa_cap; __u32 sa_fsuid; __u32 sa_fsuid_h; __u32 sa_fsgid; __u32 sa_fsgid_h; __u32 sa_suppgid; __u32 sa_suppgid_h; __u32 sa_padding_1; __u32 sa_padding_1_h; struct lu_fid sa_fid; __u64 sa_valid; __u32 sa_uid; __u32 sa_gid; __u64 sa_size; __u64 sa_blocks; obd_time sa_mtime; obd_time sa_atime; obd_time sa_ctime; __u32 sa_attr_flags; __u32 sa_mode; __u32 sa_bias; /* some operation flags */ __u32 sa_padding_3; __u32 sa_padding_4; __u32 sa_padding_5; }; ---- The 'setattr' variant modifies the semantics of the generic REINT fields as follows: There is only one FID to be operated upon, and the 'sa_valid', 'sa_uid', and 'sa_gid' values take the place of the second 'struct lu_fid' in the generic <>. See also <>. The 'sa_valid' field identifies which of the other fields in the structure are to be honored. If the corresponding flag bit is not set then the value of the corresponding field is to be ignored. The flags are: .SA Valid **** [source,c] ---- #define MDS_ATTR_MODE 0x1ULL /* = 1 */ #define MDS_ATTR_UID 0x2ULL /* = 2 */ #define MDS_ATTR_GID 0x4ULL /* = 4 */ #define MDS_ATTR_SIZE 0x8ULL /* = 8 */ #define MDS_ATTR_ATIME 0x10ULL /* = 16 */ #define MDS_ATTR_MTIME 0x20ULL /* = 32 */ #define MDS_ATTR_CTIME 0x40ULL /* = 64 */ #define MDS_ATTR_ATIME_SET 0x80ULL /* = 128 */ #define MDS_ATTR_MTIME_SET 0x100ULL /* = 256 */ #define MDS_ATTR_FORCE 0x200ULL /* = 512 */ #define MDS_ATTR_ATTR_FLAG 0x400ULL /* = 1024 */ #define MDS_ATTR_KILL_SUID 0x800ULL /* = 2048 */ #define MDS_ATTR_KILL_SGID 0x1000ULL /* = 4096 */ #define MDS_ATTR_CTIME_SET 0x2000ULL /* = 8192 */ #define MDS_ATTR_FROM_OPEN 0x4000ULL /* = 16384 */ #define MDS_ATTR_BLOCKS 0x8000ULL /* = 32768 */ ---- **** The 'sa_uid' and 'sa_gid' fields give the values of the UID and GID attributes, respectively, to be set on the target resource. There is no umask for the 'setattr' variant, and no high order bytes for the flags attribute. Otherwise, the order of the attributes is different in the structure, but their semantics remains the same as for the generic case.