3 [[struct-llog-log-hdr]]
8 struct llog_rec_hdr llh_hdr;
9 obd_time llh_timestamp;
11 __u32 llh_bitmap_offset;
15 /* for a catalog the first plain slot is next to it */
16 struct obd_uuid llh_tgtuuid;
17 __u32 llh_reserved[LLOG_HEADER_SIZE/sizeof(__u32) - 23];
18 __u32 llh_bitmap[LLOG_BITMAP_BYTES/sizeof(__u32)];
19 struct llog_rec_tail llh_tail;
23 The llog records start and end on a record size boundary, typically
24 8192 bytes, or as stored in 'llh_size', which allows some degree of
25 random access within the llog file, even with variable record sizes.
26 It is possible to interpolate the offset of an arbitrary record
27 within the file by estimating the byte offset of a particular record
28 index using 'llh_count' and the llog file size and aligning it to
29 the chunk boundary 'llh_size'. The record index in the 'llog_rec_hdr'
30 of the first record in that chunk can be used to further refine the
31 estimate of the offset of the desired index down to a single chunk,
32 and then sequential access can be used to find the actual record.
35 Each llog file begins with an 'llog_log_hdr' that describes the llog
36 file itself, followed by a series of log records that are appended
37 sequentially to the file. Each record, including the header itself,
38 begins with an 'llog_rec_hdr' and ends with an 'llog_rec_tail'.
41 The lgd_llh_flags are:
48 LLOG_F_ZAP_WHEN_EMPTY = 0x1,
50 LLOG_F_IS_PLAIN = 0x4,
56 [[struct-llog-rec-hdr]]
69 The 'llog_rec_hdr' is at the start of each llog record and describes
70 the log record. 'lrh_len' holds the record size in bytes, including
71 the header and tail. 'lrh_index' is the record index within the llog
72 file and is sequentially increasing for each subsequent record. It
73 can be used to determine the offset within the llog file when searching
74 for an arbitrary record within the file. 'lrh_type' describes the type
75 of data stored in this record.
82 LLOG_PAD_MAGIC = LLOG_OP_MAGIC | 0x00000,
83 OST_SZ_REC = LLOG_OP_MAGIC | 0x00f00,
84 MDS_UNLINK64_REC = LLOG_OP_MAGIC | 0x90000 | (MDS_REINT << 8) |
86 MDS_SETATTR64_REC = LLOG_OP_MAGIC | 0x90000 | (MDS_REINT << 8) |
88 OBD_CFG_REC = LLOG_OP_MAGIC | 0x20000,
89 LLOG_GEN_REC = LLOG_OP_MAGIC | 0x40000,
90 CHANGELOG_REC = LLOG_OP_MAGIC | 0x60000,
91 CHANGELOG_USER_REC = LLOG_OP_MAGIC | 0x70000,
92 HSM_AGENT_REC = LLOG_OP_MAGIC | 0x80000,
93 UPDATE_REC = LLOG_OP_MAGIC | 0xa0000,
94 LLOG_HDR_MAGIC = LLOG_OP_MAGIC | 0x45539,
95 LLOG_LOGID_MAGIC = LLOG_OP_MAGIC | 0x4553b,
101 [[struct-llog-rec-tail]]
105 struct llog_rec_tail {
112 The 'llog_rec_tail' is at the end of each llog record. The 'lrt_len'
113 and 'lrt_index' fields must be the same as 'lrh_len' and 'lrh_index'
114 in the header. They can be used to verify record integrity, as well
115 as allowing processing the llog records in reverse order.