/* *Flagstologoperationheader * *Thefirstwriteofanewtransactionwillbeprecededwithastart *record,XLOG_START_TRANS.Onceatransactioniscommitted,acommit *recordiswritten,XLOG_COMMIT_TRANS.Ifasingleregioncannotfitinto *theremainderofthecurrentactivein-corelog,itissplitupinto *multipleregions.Eachpartialregionwillbemarkedwitha *XLOG_CONTINUE_TRANSuntilthelastone,whichgetsmarkedwithXLOG_END_TRANS. *
*/ #define XLOG_START_TRANS 0x01 /* Start a new transaction */ #define XLOG_COMMIT_TRANS 0x02 /* Commit this transaction */ #define XLOG_CONTINUE_TRANS 0x04 /* Cont this trans into new region */ #define XLOG_WAS_CONT_TRANS 0x08 /* Cont this trans into new region */ #define XLOG_END_TRANS 0x10 /* End a continued transaction */ #define XLOG_UNMOUNT_TRANS 0x20 /* Unmount a filesystem transaction */
typedefstruct xlog_op_header {
__be32 oh_tid; /* transaction id of operation : 4 b */
__be32 oh_len; /* bytes in data region : 4 b */
__u8 oh_clientid; /* who sent me this : 1 b */
__u8 oh_flags; /* : 1 b */
__u16 oh_res2; /* 32 bit align : 2 b */
} xlog_op_header_t;
typedefstruct xlog_rec_header {
__be32 h_magicno; /* log record (LR) identifier : 4 */
__be32 h_cycle; /* write cycle of log : 4 */
__be32 h_version; /* LR version : 4 */
__be32 h_len; /* len in bytes; should be 64-bit aligned: 4 */
__be64 h_lsn; /* lsn of this LR : 8 */
__be64 h_tail_lsn; /* lsn of 1st LR w/ buffers not committed: 8 */
__le32 h_crc; /* crc of log record : 4 */
__be32 h_prev_block; /* block number to previous LR : 4 */
__be32 h_num_logops; /* number of log operations in this LR : 4 */
__be32 h_cycle_data[XLOG_HEADER_CYCLE_SIZE / BBSIZE];
/* fields added by the Linux port: */
__be32 h_fmt; /* format of log record : 4 */
uuid_t h_fs_uuid; /* uuid of FS : 16 */
/* not an on-disk structure, but needed by log recovery in userspace */ typedefstruct xfs_log_iovec { void *i_addr; /* beginning address of region */ int i_len; /* length in bytes of region */
uint i_type; /* type of region */
} xfs_log_iovec_t;
/* *TransactionHeaderdefinitions. * *Thisisthestructurewritteninthelogattheheadofeverytransaction.It *identifiesthetypeandidofthetransaction,andcontainsthenumberof *itemsloggedbythetransactionsoweknowhowmanytoexpectduring *recovery. * *Donotchangethebelowstructurewithoutredoingthecodein *xlog_recover_add_to_trans()andxlog_recover_add_to_cont_trans().
*/ typedefstruct xfs_trans_header {
uint th_magic; /* magic number */
uint th_type; /* transaction type */
int32_t th_tid; /* transaction id (unused) */
uint th_num_items; /* num items logged by trans */
} xfs_trans_header_t;
/* *Definetheformatoftheinodecorethatislogged.Thisstructuremustbe *keptidenticaltostructxfs_dinodeexceptfortheendiannessannotations.
*/ struct xfs_log_dinode {
uint16_t di_magic; /* inode magic # = XFS_DINODE_MAGIC */
uint16_t di_mode; /* mode and type of file */
int8_t di_version; /* inode version */
int8_t di_format; /* format of di_c data */
uint16_t di_metatype; /* metadata type, if DIFLAG2_METADATA */
uint32_t di_uid; /* owner's user id */
uint32_t di_gid; /* owner's group id */
uint32_t di_nlink; /* number of links to file */
uint16_t di_projid_lo; /* lower part of owner's project id */
uint16_t di_projid_hi; /* higher part of owner's project id */ union { /* Number of data fork extents if NREXT64 is set */
uint64_t di_big_nextents;
/* Padding for V3 inodes without NREXT64 set. */
uint64_t di_v3_pad;
/* Padding and inode flush counter for V2 inodes. */ struct {
uint8_t di_v2_pad[6]; /* V2 inode zeroed space */
uint16_t di_flushiter; /* V2 inode incremented on flush */
};
};
xfs_log_timestamp_t di_atime; /* time last accessed */
xfs_log_timestamp_t di_mtime; /* time last modified */
xfs_log_timestamp_t di_ctime; /* time created/inode modified */
xfs_fsize_t di_size; /* number of bytes in file */
xfs_rfsblock_t di_nblocks; /* # of direct & btree blocks used */
xfs_extlen_t di_extsize; /* basic/minimum extent size for file */ union { /* *ForV2inodesandV3inodeswithoutNREXT64set,this *isthenumberofdataandattrforkextents.
*/ struct {
uint32_t di_nextents;
uint16_t di_anextents;
} __packed;
/* Number of attr fork extents if NREXT64 is set. */ struct {
uint32_t di_big_anextents;
uint16_t di_nrext64_pad;
} __packed;
} __packed;
uint8_t di_forkoff; /* attr fork offs, <<3 for 64b align */
int8_t di_aformat; /* format of attr fork's data */
uint32_t di_dmevmask; /* DMIG event mask */
uint16_t di_dmstate; /* DMIG state info */
uint16_t di_flags; /* random flags, XFS_DIFLAG_... */
uint32_t di_gen; /* generation number */
/* di_next_unlinked is the only non-core field in the old dinode */
xfs_agino_t di_next_unlinked;/* agi unlinked list ptr */
/* start of the extended dinode, writable fields */
uint32_t di_crc; /* CRC of the inode */
uint64_t di_changecount; /* number of attribute changes */
uint64_t di_flags2; /* more random flags */ union { /* basic cow extent size for (regular) file */
uint32_t di_cowextsize; /* used blocks in RTG for (zoned) rtrmap inode */
uint32_t di_used_blocks;
};
uint8_t di_pad2[12]; /* more padding for future expansion */
/* fields only written to during inode creation */
xfs_log_timestamp_t di_crtime; /* time created */
xfs_ino_t di_ino; /* inode number */
uuid_t di_uuid; /* UUID of the filesystem */
/* structure must be padded to 64 bit alignment */
};
typedefstruct xfs_buf_log_format { unsignedshort blf_type; /* buf log item type indicator */ unsignedshort blf_size; /* size of this item */ unsignedshort blf_flags; /* misc state */ unsignedshort blf_len; /* number of blocks in this buf */
int64_t blf_blkno; /* starting blkno of this buf */ unsignedint blf_map_size; /* used size of data bitmap in words */ unsignedint blf_data_map[XFS_BLF_DATAMAP_SIZE]; /* dirty bitmap */
} xfs_buf_log_format_t;
/* refcount pe_flags: upper bits are flags, lower byte is type code */ /* Type codes are taken directly from enum xfs_refcount_intent_type. */ #define XFS_REFCOUNT_EXTENT_TYPE_MASK 0xFF
/* bmbt me_flags: upper bits are flags, lower byte is type code */ /* Type codes are taken directly from enum xfs_bmap_intent_type. */ #define XFS_BMAP_EXTENT_TYPE_MASK 0xFF
/* This is the structure used to lay out an mapping exchange log item. */ struct xfs_xmi_log_format {
uint16_t xmi_type; /* xmi log item type */
uint16_t xmi_size; /* size of this item */
uint32_t __pad; /* must be zero */
uint64_t xmi_id; /* xmi identifier */
uint64_t xmi_inode1; /* inumber of first file */
uint64_t xmi_inode2; /* inumber of second file */
uint32_t xmi_igen1; /* generation of first file */
uint32_t xmi_igen2; /* generation of second file */
uint64_t xmi_startoff1; /* block offset into file1 */
uint64_t xmi_startoff2; /* block offset into file2 */
uint64_t xmi_blockcount; /* number of blocks */
uint64_t xmi_flags; /* XFS_EXCHMAPS_* */
uint64_t xmi_isize1; /* intended file1 size */
uint64_t xmi_isize2; /* intended file2 size */
};
/* Exchange mappings between extended attribute forks instead of data forks. */ #define XFS_EXCHMAPS_ATTR_FORK (1ULL << 0)
/* Set the file sizes when finished. */ #define XFS_EXCHMAPS_SET_SIZES (1ULL << 1)
/* This is the structure used to lay out an mapping exchange done log item. */ struct xfs_xmd_log_format {
uint16_t xmd_type; /* xmd log item type */
uint16_t xmd_size; /* size of this item */
uint32_t __pad;
uint64_t xmd_xmi_id; /* id of corresponding xmi */
};
/* *DquotLogformatdefinitions. * *Thefirsttwofieldsmustbethetypeandsizefittinginto *32bits:log_recoverycodeassumesthat.
*/ typedefstruct xfs_dq_logformat {
uint16_t qlf_type; /* dquot log item type */
uint16_t qlf_size; /* size of this item */
xfs_dqid_t qlf_id; /* usr/grp/proj id : 32 bits */
int64_t qlf_blkno; /* blkno of dquot buffer */
int32_t qlf_len; /* len of dquot buffer */
uint32_t qlf_boffset; /* off of dquot in buffer */
} xfs_dq_logformat_t;
/* *Inodecreatelogitemstructure * *Logrecoveryassumesthefirsttwoentriesarethetypeandsizeandtheyfit *in32bits.Alsoinhostorder(ugh)sotheyhavetobe32bitalignedso *decodingcanbedonecorrectly.
*/ struct xfs_icreate_log {
uint16_t icl_type; /* type of log format structure */
uint16_t icl_size; /* size of log format structure */
__be32 icl_ag; /* ag being allocated in */
__be32 icl_agbno; /* start block of inode range */
__be32 icl_count; /* number of inodes to initialise */
__be32 icl_isize; /* size of inodes */
__be32 icl_length; /* length of extent to initialise */
__be32 icl_gen; /* inode generation number to use */
};
/* *Flagsfordeferredattributeoperations. *Upperbitsareflags,lowerbyteistypecode
*/ #define XFS_ATTRI_OP_FLAGS_SET 1/* Set the attribute */ #define XFS_ATTRI_OP_FLAGS_REMOVE 2/* Remove the attribute */ #define XFS_ATTRI_OP_FLAGS_REPLACE 3/* Replace the attribute */ #define XFS_ATTRI_OP_FLAGS_PPTR_SET 4/* Set parent pointer */ #define XFS_ATTRI_OP_FLAGS_PPTR_REMOVE 5/* Remove parent pointer */ #define XFS_ATTRI_OP_FLAGS_PPTR_REPLACE 6/* Replace parent pointer */ #define XFS_ATTRI_OP_FLAGS_TYPE_MASK 0xFF /* Flags type mask */
/* *Thisisthestructureusedtolayoutanattrlogiteminthe *log.
*/ struct xfs_attri_log_format {
uint16_t alfi_type; /* attri log item type */
uint16_t alfi_size; /* size of this item */
uint32_t alfi_igen; /* generation of alfi_ino for pptr ops */
uint64_t alfi_id; /* attri identifier */
uint64_t alfi_ino; /* the inode for this attr operation */
uint32_t alfi_op_flags; /* marks the op as a set or remove */ union {
uint32_t alfi_name_len; /* attr name length */ struct { /* *ForPPTR_REPLACE,thesearethelengthsoftheold *andnewattrnames.Thenewandoldvaluesmust *havethesamelength.
*/
uint16_t alfi_old_name_len;
uint16_t alfi_new_name_len;
};
};
uint32_t alfi_value_len; /* attr value length */
uint32_t alfi_attr_filter;/* attr filter flags */
};
struct xfs_attrd_log_format {
uint16_t alfd_type; /* attrd log item type */
uint16_t alfd_size; /* size of this item */
uint32_t __pad; /* pad to 64 bit aligned */
uint64_t alfd_alf_id; /* id of corresponding attri */
};
#endif/* __XFS_LOG_FORMAT_H__ */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.27 Sekunden
(vorverarbeitet am 2026-09-27)
¤