1 This is all the structs defined in lustre_idl.h iand lustre_user.h, in
2 the lustre/include/lustre/ directory, in support of the message format
3 symbols. If the right column has <none> that means there is no
4 corresponding "RMF_BLA" declaration, it is either unused or used in a
5 way I haven't quite sorted out. If there is an X in the right column
6 then the RMF_BLA declaration's name is identical to the 'struct'
7 declaration, but if the "name" is different it is noted in
8 parentheses. If there is a name in the right column then the space
9 allocated for the RMF_BLA declaration is the size for this struct, but
10 the name in the RMF_BLA declaration doesn't exactly match. The
11 ptlrpc_body_v2 and ptlrpc_body_v3 structs do not appear in any
12 declarations, but there is a #DEFINE for ptlrpc_body that defines it
13 as ptlrpc_body_v3 so I treat it as matching. A #if construct will
14 substitute obd_connect_data_v1 for obdconnect_data in code from
15 Lustre-2.0 and before.
17 struct definiiton RMF_* name
18 ----------------- -----------
19 close_data X (data_version)
20 getinfo_fid2path <none>
22 hsm_progress_kernel hsm_progress
33 ll_fiemap_info_key fiemap
34 llog_cookie llog_cookies
39 lu_seq_range fld_query_mdfld
41 lustre_capa_key <none>
42 lustre_msg_v2 [the is the header, not a message format, per se]
43 mdc_swap_layouts swap_layouts
46 mdt_rec_reint rec_reint
48 mgs_config_res X (mgs_config_read reply)
52 obd_connect_data cdata
53 obd_connect_data_v1 <none>
59 object_update_param <none>
61 object_update_request <none>
62 object_update_result <none>
65 ptlrpc_body_v3 X (as ptlrpc_body)
68 ----------------------------------------------------------------------
69 These are definitions from the header files that appear in
70 structures.txt but are not (or do not correspond to) struct
74 # define LUSTRE_POSIX_ACL_MAX_SIZE \
75 (sizeof(posix_acl_xattr_header) + \
76 LUSTRE_POSIX_ACL_MAX_ENTRIES * sizeof(posix_acl_xattr_entry))
79 #define MIN_MD_SIZE (sizeof(struct lov_mds_md) + 1 * sizeof(struct lov_ost_data))
81 ----------------------------------------------------------------------
83 The following are the actual struct definitions for the two header
84 files. Which file is listed, then the struct defnition.
88 struct lustre_handle cd_handle;
90 __u64 cd_data_version;
95 struct hsm_current_action {
96 /** The current undergoing action, if there is one */
97 /* state is one of hsm_progress_states */
99 /* action is one of hsm_user_action */
101 struct hsm_extent hca_location;
108 } __attribute__((packed));
111 struct hsm_progress_kernel {
112 /* Field taken from struct hsm_progress */
115 struct hsm_extent hpk_extent;
117 __u16 hpk_errval; /* positive val */
119 /* Additional fields */
120 __u64 hpk_data_version;
122 } __attribute__((packed));
126 __u32 hr_action; /* enum hsm_user_action */
127 __u32 hr_archive_id; /* archive id, used only with HUA_ARCHIVE */
128 __u64 hr_flags; /* request flags */
129 __u32 hr_itemcount; /* item count in hur_user_item vector */
134 struct hsm_state_set {
136 __u32 hss_archive_id;
142 struct hsm_user_item {
144 struct hsm_extent hui_extent;
145 } __attribute__((packed));
148 struct hsm_user_state {
149 /** Current HSM states, from enum hsm_states. */
151 __u32 hus_archive_id;
152 /** The current undergoing action, if there is one */
153 __u32 hus_in_progress_state;
154 __u32 hus_in_progress_action;
155 struct hsm_extent hus_in_progress_location;
156 char hus_extended_info[];
163 /* reply: see idx_info_flags below */
166 /* request & reply: number of lu_idxpage (to be) transferred */
170 /* request: requested attributes passed down to the iterator API */
173 /* request & reply: index file identifier (FID) */
174 struct lu_fid ii_fid;
176 /* reply: version of the index file before starting to walk the index.
177 * Please note that the version can be modified at any time during the
181 /* request: hash to start with:
182 * reply: hash of the first entry of the first lu_idxpage and hash
183 * of the entry to read next if any */
187 /* reply: size of keys in lu_idxpages, minimal one if II_FL_VARKEY is
191 /* reply: size of records in lu_idxpages, minimal one if II_FL_VARREC
201 struct layout_intent {
202 __u32 li_opc; /* intent operation for enqueue, read, write etc */
210 struct ldlm_gl_lquota_desc lquota_desc;
214 struct ldlm_gl_lquota_desc {
215 union lquota_id gl_id; /* quota ID subject to the glimpse */
216 __u64 gl_flags; /* see LQUOTA_FL* below */
217 __u64 gl_ver; /* new index version */
218 __u64 gl_hardlimit; /* new hardlimit or qunit value */
219 __u64 gl_softlimit; /* new softlimit */
230 struct ldlm_lock_desc {
231 struct ldlm_resource_desc l_resource;
232 ldlm_mode_t l_req_mode;
233 ldlm_mode_t l_granted_mode;
234 ldlm_wire_policy_data_t l_policy_data;
240 __u32 lock_padding; /* also fix lustre_swab_ldlm_reply */
241 struct ldlm_lock_desc lock_desc;
242 struct lustre_handle lock_handle;
243 __u64 lock_policy_res1;
244 __u64 lock_policy_res2;
248 struct ldlm_request {
251 struct ldlm_lock_desc lock_desc;
252 struct lustre_handle lock_handle[LDLM_LOCKREQ_HANDLES];
256 #define RES_NAME_SIZE 4
258 __u64 name[RES_NAME_SIZE];
262 struct ldlm_resource_desc {
264 __u32 lr_padding; /* also fix lustre_swab_ldlm_resource_desc */
265 struct ldlm_res_id lr_name;
276 struct lfsck_request {
289 __u16 lr_async_windows;
291 struct lu_fid lr_fid;
292 struct lu_fid lr_fid2;
293 struct lu_fid lr_fid3;
299 struct ll_fiemap_info_key {
302 struct ll_user_fiemap fiemap;
306 struct ll_user_fiemap {
307 __u64 fm_start; /* logical offset (inclusive) at
308 * which to start mapping (in) */
309 __u64 fm_length; /* logical length of mapping which
310 * userspace wants (in) */
311 __u32 fm_flags; /* FIEMAP_FLAG_* flags for request (in/out) */
312 __u32 fm_mapped_extents;/* number of extents that were mapped (out) */
313 __u32 fm_extent_count; /* size of fm_extents array (in) */
315 struct ll_fiemap_extent fm_extents[0]; /* array of mapped extents (out) */
319 struct ll_fiemap_extent {
320 __u64 fe_logical; /* logical offset in bytes for the start of
321 * the extent from the beginning of the file */
322 __u64 fe_physical; /* physical offset in bytes for the start
323 * of the extent from the beginning of the disk */
324 __u64 fe_length; /* length in bytes for this extent */
325 __u64 fe_reserved64[2];
326 __u32 fe_flags; /* FIEMAP_EXTENT_* flags for this extent */
327 __u32 fe_device; /* device number for this extent */
328 __u32 fe_reserved[2];
333 struct llog_logid lgc_lgl;
337 } __attribute__((packed));
343 } __attribute__((packed));
346 struct llog_log_hdr {
347 struct llog_rec_hdr llh_hdr;
350 __u32 llh_bitmap_offset;
354 /* for a catalog the first plain slot is next to it */
355 struct obd_uuid llh_tgtuuid;
356 __u32 llh_reserved[LLOG_HEADER_SIZE/sizeof(__u32) - 23];
357 __u32 llh_bitmap[LLOG_BITMAP_BYTES/sizeof(__u32)];
358 struct llog_rec_tail llh_tail;
359 } __attribute__((packed));
363 struct ost_id lgl_oi;
365 } __attribute__((packed));
368 struct llog_rec_hdr {
376 struct llog_rec_tail {
383 struct llog_logid lgd_logid;
387 __u32 lgd_saved_index;
389 __u64 lgd_cur_offset;
390 } __attribute__((packed));
393 struct llogd_conn_body {
394 struct llog_gen lgdc_gen;
395 struct llog_logid lgdc_logid;
397 } __attribute__((packed));
399 #define lov_mds_md lov_mds_md_v1
400 struct lov_mds_md_v1 { /* LOV EA mds/wire data (little-endian) */
401 __u32 lmm_magic; /* magic number = LOV_MAGIC_V1 */
402 __u32 lmm_pattern; /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */
403 struct ost_id lmm_oi; /* LOV object ID */
404 __u32 lmm_stripe_size; /* size of stripe in bytes */
405 /* lmm_stripe_count used to be __u32 */
406 __u16 lmm_stripe_count; /* num stripes in use for this object */
407 __u16 lmm_layout_gen; /* layout generation number */
408 struct lov_ost_data_v1 lmm_objects[0]; /* per-stripe data */
412 #define lov_ost_data lov_ost_data_v1
413 struct lov_ost_data_v1 { /* per-stripe data structure (little-endian)*/
414 struct ost_id l_ost_oi; /* OST object ID */
415 __u32 l_ost_gen; /* generation of this l_ost_idx */
416 __u32 l_ost_idx; /* OST index in LOV (lov_tgt_desc->tgts) */
422 * FID sequence. Sequence is a unit of migration: all files (objects)
423 * with FIDs from a given sequence are stored on the same server.
424 * Lustre should support 2^64 objects, so even if each sequence
425 * has only a single object we can still enumerate 2^64 objects.
428 /* FID number within sequence. */
431 * FID version, used to distinguish different versions (in the sense
432 * of snapshots, etc.) of the same file system object. Not currently
439 struct lu_seq_range {
448 struct lu_fid lc_fid; /** fid */
449 __u64 lc_opc; /** operations allowed */
450 __u64 lc_uid; /** file owner */
451 __u64 lc_gid; /** file group */
452 __u32 lc_flags; /** HMAC algorithm & flags */
453 __u32 lc_keyid; /** key# used for the capability */
454 __u32 lc_timeout; /** capa timeout value (sec) */
455 __u32 lc_expiry; /** expiry time (sec) */
456 __u8 lc_hmac[CAPA_HMAC_MAX_LEN]; /** HMAC */
457 } __attribute__((packed));
460 struct lustre_handle {
465 struct lustre_msg_v2 {
478 struct mdc_swap_layouts {
484 struct lu_fid mbo_fid1;
485 struct lu_fid mbo_fid2;
486 struct lustre_handle mbo_handle;
488 __u64 mbo_size; /* Offset, in the case of MDS_READPAGE */
492 __u64 mbo_blocks; /* XID, in the case of MDS_READPAGE */
494 __u64 mbo_t_state; /* transient file state defined in
495 * enum md_transient_state
496 * was "ino" until 2.4.0 */
499 __u32 mbo_capability;
505 __u32 mbo_nlink; /* #bytes to read in the case of MDS_READPAGE */
506 __u32 mbo_unused2; /* was "generation" until 2.4.0 */
508 __u32 mbo_eadatasize;
510 __u32 mbo_max_mdsize;
511 __u32 mbo_max_cookiesize;
512 __u32 mbo_uid_h; /* high 32-bits of uid, for FUID */
513 __u32 mbo_gid_h; /* high 32-bits of gid, for FUID */
514 __u32 mbo_padding_5; /* also fix lustre_swab_mdt_body */
519 __u64 mbo_padding_10;
524 struct lustre_handle handle;
531 struct mdt_rec_reint {
542 struct lu_fid rr_fid1;
543 struct lu_fid rr_fid2;
554 __u32 rr_padding_4; /* also fix lustre_swab_mdt_rec_reint */
558 struct mgs_config_res {
559 __u64 mcr_offset; /* index of last config log */
560 __u64 mcr_size; /* size of the log */
564 struct mgs_send_param {
565 char mgs_param[MGS_PARAM_MAXLEN];
569 struct mgs_target_info {
570 __u32 mti_lustre_ver;
571 __u32 mti_stripe_index;
572 __u32 mti_config_ver;
575 __u32 mti_instance; /* Running instance of target */
576 char mti_fsname[MTI_NAME_MAXLEN];
577 char mti_svname[MTI_NAME_MAXLEN];
578 char mti_uuid[sizeof(struct obd_uuid)];
579 __u64 mti_nids[MTI_NIDS_MAX]; /* host nids (lnet_nid_t)*/
580 char mti_params[MTI_PARAM_MAXLEN];
584 struct niobuf_remote {
591 struct obd_connect_data {
592 __u64 ocd_connect_flags; /* OBD_CONNECT_* per above */
593 __u32 ocd_version; /* lustre release version number */
594 __u32 ocd_grant; /* initial cache grant amount (bytes) */
595 __u32 ocd_index; /* LOV index to connect to */
596 __u32 ocd_brw_size; /* Maximum BRW size in bytes */
597 __u64 ocd_ibits_known; /* inode bits this client understands */
598 __u8 ocd_blocksize; /* log2 of the backend filesystem blocksize */
599 __u8 ocd_inodespace; /* log2 of the per-inode space consumption */
600 __u16 ocd_grant_extent; /* per-extent grant overhead, in 1K blocks */
601 __u32 ocd_unused; /* also fix lustre_swab_connect */
602 __u64 ocd_transno; /* first transno from client to be replayed */
603 __u32 ocd_group; /* MDS group on OST */
604 __u32 ocd_cksum_types; /* supported checksum algorithms */
605 __u32 ocd_max_easize; /* How big LOV EA can be on MDS */
606 __u32 ocd_instance; /* instance # of this target */
607 __u64 ocd_maxbytes; /* Maximum stripe size in bytes */
608 /* Fields after ocd_maxbytes are only accessible by the receiver
609 * if the corresponding flag in ocd_connect_flags is set. Accessing
610 * any field after ocd_maxbytes on the receiver without a valid flag
611 * may result in out-of-bound memory access and kernel oops. */
612 __u64 padding1; /* added 2.1.0. also fix lustre_swab_connect */
613 __u64 padding2; /* added 2.1.0. also fix lustre_swab_connect */
614 __u64 padding3; /* added 2.1.0. also fix lustre_swab_connect */
615 __u64 padding4; /* added 2.1.0. also fix lustre_swab_connect */
616 __u64 padding5; /* added 2.1.0. also fix lustre_swab_connect */
617 __u64 padding6; /* added 2.1.0. also fix lustre_swab_connect */
618 __u64 padding7; /* added 2.1.0. also fix lustre_swab_connect */
619 __u64 padding8; /* added 2.1.0. also fix lustre_swab_connect */
620 __u64 padding9; /* added 2.1.0. also fix lustre_swab_connect */
621 __u64 paddingA; /* added 2.1.0. also fix lustre_swab_connect */
622 __u64 paddingB; /* added 2.1.0. also fix lustre_swab_connect */
623 __u64 paddingC; /* added 2.1.0. also fix lustre_swab_connect */
624 __u64 paddingD; /* added 2.1.0. also fix lustre_swab_connect */
625 __u64 paddingE; /* added 2.1.0. also fix lustre_swab_connect */
626 __u64 paddingF; /* added 2.1.0. also fix lustre_swab_connect */
631 __u64 dqb_bhardlimit;
632 __u64 dqb_bsoftlimit;
634 __u64 dqb_ihardlimit;
635 __u64 dqb_isoftlimit;
653 struct ost_id ioo_oid; /* object ID, if multi-obj BRW */
654 __u32 ioo_max_brw; /* low 16 bits were o_mode before 2.4,
655 * now (PTLRPC_BULK_OPS_COUNT - 1) in
656 * high 16 bits in 2.4 and later */
657 __u32 ioo_bufcnt; /* number of niobufs for this object */
661 struct obd_quotactl {
663 __u32 qc_type; /* see Q_* flag below */
666 struct obd_dqinfo qc_dqinfo;
667 struct obd_dqblk qc_dqblk;
682 __u32 os_state; /**< obd_statfs_state OS_STATE_* flag */
683 __u32 os_fprecreated; /* objs available now to the caller */
684 /* used in QoS code to find preferred
703 __u64 o_valid; /* hot fields in this obdo */
706 __u64 o_size; /* o_size-o_blocks == ost_lvb */
710 __u64 o_blocks; /* brw: cli sent cached bytes */
713 /* 32-bit fields start here: keep an even number of them via padding */
714 __u32 o_blksize; /* optimal IO blocksize */
715 __u32 o_mode; /* brw: cli sent cache remain */
719 __u32 o_nlink; /* brw: checksum */
721 __u32 o_misc; /* brw: o_dropped */
723 __u64 o_ioepoch; /* epoch in ost writes */
724 __u32 o_stripe_idx; /* holds stripe idx */
726 struct lustre_handle o_handle; /* brw: lock handle to prolong
728 struct llog_cookie o_lcookie; /* destroy: unlink cookie from
733 __u64 o_data_version; /* getattr: sum of iversion for
735 * brw: grant space consumed on
736 * the client for the write */
754 struct lu_fid oi_fid;
759 struct ptlrpc_body_v3 {
760 struct lustre_handle pb_handle;
767 __u64 pb_last_committed;
772 __u32 pb_timeout; /* for req, the deadline, for rep, the service est */
773 __u32 pb_service_time; /* for rep, actual service time */
776 /* VBR: pre-versions */
777 __u64 pb_pre_versions[PTLRPC_NUM_VERSIONS];
778 /* padding for future needs */
780 char pb_jobid[LUSTRE_JOBID_SIZE];
785 struct lu_fid qb_fid; /* FID of global index packing the pool ID
786 * and type (data or metadata) as well as
787 * the quota type (user or group). */
788 union lquota_id qb_id; /* uid or gid or directory FID */
789 __u32 qb_flags; /* see below */
791 __u64 qb_count; /* acquire/release count (kbytes/inodes) */
792 __u64 qb_usage; /* current slave usage (kbytes/inodes) */
793 __u64 qb_slv_ver; /* slave index file version */
794 struct lustre_handle qb_lockh; /* per-ID lock handle */
795 struct lustre_handle qb_glb_lockh; /* global lock handle */
796 __u64 qb_padding1[4];