]>
Commit | Line | Data |
---|---|---|
2bd0ea18 | 1 | /* |
da23017d NS |
2 | * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc. |
3 | * All Rights Reserved. | |
dfc130f3 | 4 | * |
da23017d NS |
5 | * This program is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU General Public License as | |
2bd0ea18 | 7 | * published by the Free Software Foundation. |
dfc130f3 | 8 | * |
da23017d NS |
9 | * This program is distributed in the hope that it would be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
dfc130f3 | 13 | * |
da23017d NS |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write the Free Software Foundation, | |
16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
2bd0ea18 | 17 | */ |
6b803e5a CH |
18 | #include "libxfs.h" |
19 | #include "libxlog.h" | |
2bd0ea18 NS |
20 | |
21 | #include "logprint.h" | |
22 | ||
2bd0ea18 NS |
23 | /* |
24 | * Start is defined to be the block pointing to the oldest valid log record. | |
2bd0ea18 NS |
25 | */ |
26 | int | |
27 | xlog_print_find_oldest( | |
999f0b9c | 28 | struct xlog *log, |
15c81278 | 29 | xfs_daddr_t *last_blk) |
2bd0ea18 NS |
30 | { |
31 | xfs_buf_t *bp; | |
32 | xfs_daddr_t first_blk; | |
15c81278 | 33 | uint first_half_cycle, last_half_cycle; |
a134873e | 34 | int error = 0; |
dfc130f3 | 35 | |
2bd0ea18 NS |
36 | if (xlog_find_zeroed(log, &first_blk)) |
37 | return 0; | |
38 | ||
39 | first_blk = 0; /* read first block */ | |
15c81278 | 40 | bp = xlog_get_bp(log, 1); |
c40bdaa2 | 41 | xlog_bread_noalign(log, 0, 1, bp); |
5e656dbb | 42 | first_half_cycle = xlog_get_cycle(XFS_BUF_PTR(bp)); |
2bd0ea18 | 43 | *last_blk = log->l_logBBsize-1; /* read last block */ |
c40bdaa2 | 44 | xlog_bread_noalign(log, *last_blk, 1, bp); |
5e656dbb | 45 | last_half_cycle = xlog_get_cycle(XFS_BUF_PTR(bp)); |
2bd0ea18 NS |
46 | ASSERT(last_half_cycle != 0); |
47 | ||
a134873e | 48 | if (first_half_cycle == last_half_cycle) /* all cycle nos are same */ |
2bd0ea18 | 49 | *last_blk = 0; |
a134873e | 50 | else /* have 1st and last; look for middle cycle */ |
2bd0ea18 NS |
51 | error = xlog_find_cycle_start(log, bp, first_blk, |
52 | last_blk, last_half_cycle); | |
2bd0ea18 NS |
53 | |
54 | xlog_put_bp(bp); | |
a134873e | 55 | return error; |
15c81278 | 56 | } |
2bd0ea18 NS |
57 | |
58 | void | |
59 | xlog_recover_print_data( | |
d60ba955 | 60 | char *p, |
dfc130f3 | 61 | int len) |
2bd0ea18 NS |
62 | { |
63 | if (print_data) { | |
64 | uint *dp = (uint *)p; | |
65 | int nums = len >> 2; | |
66 | int j = 0; | |
67 | ||
68 | while (j < nums) { | |
69 | if ((j % 8) == 0) | |
70 | printf("%2x ", j); | |
71 | printf("%8x ", *dp); | |
72 | dp++; | |
73 | j++; | |
74 | if ((j % 8) == 0) | |
75 | printf("\n"); | |
76 | } | |
77 | printf("\n"); | |
78 | } | |
15c81278 | 79 | } |
2bd0ea18 NS |
80 | |
81 | STATIC void | |
82 | xlog_recover_print_buffer( | |
15c81278 | 83 | xlog_recover_item_t *item) |
2bd0ea18 NS |
84 | { |
85 | xfs_agi_t *agi; | |
86 | xfs_agf_t *agf; | |
2bd0ea18 | 87 | xfs_buf_log_format_t *f; |
d60ba955 | 88 | char *p; |
2bd0ea18 NS |
89 | int len, num, i; |
90 | xfs_daddr_t blkno; | |
91 | xfs_disk_dquot_t *ddq; | |
92 | ||
93 | f = (xfs_buf_log_format_t *)item->ri_buf[0].i_addr; | |
2bd0ea18 | 94 | printf(" "); |
5e656dbb | 95 | ASSERT(f->blf_type == XFS_LI_BUF); |
9ee7055c | 96 | printf(_("BUF: #regs:%d start blkno:0x%llx len:%d bmap size:%d flags:0x%x\n"), |
5e656dbb BN |
97 | f->blf_size, (long long)f->blf_blkno, f->blf_len, f->blf_map_size, f->blf_flags); |
98 | blkno = (xfs_daddr_t)f->blf_blkno; | |
2bd0ea18 NS |
99 | num = f->blf_size-1; |
100 | i = 1; | |
101 | while (num-- > 0) { | |
102 | p = item->ri_buf[i].i_addr; | |
103 | len = item->ri_buf[i].i_len; | |
104 | i++; | |
105 | if (blkno == 0) { /* super block */ | |
9ee7055c | 106 | printf(_(" SUPER Block Buffer:\n")); |
f8149110 | 107 | if (!print_buffer) |
5e656dbb | 108 | continue; |
f934f4a5 AE |
109 | printf(_(" icount:%llu ifree:%llu "), |
110 | (unsigned long long) | |
111 | be64_to_cpu(*(__be64 *)(p)), | |
112 | (unsigned long long) | |
113 | be64_to_cpu(*(__be64 *)(p+8))); | |
114 | printf(_("fdblks:%llu frext:%llu\n"), | |
115 | (unsigned long long) | |
116 | be64_to_cpu(*(__be64 *)(p+16)), | |
117 | (unsigned long long) | |
118 | be64_to_cpu(*(__be64 *)(p+24))); | |
9ee7055c | 119 | printf(_(" sunit:%u swidth:%u\n"), |
5e656dbb BN |
120 | be32_to_cpu(*(__be32 *)(p+56)), |
121 | be32_to_cpu(*(__be32 *)(p+60))); | |
122 | } else if (be32_to_cpu(*(__be32 *)p) == XFS_AGI_MAGIC) { | |
a59111c1 | 123 | int bucket, buckets; |
2bd0ea18 | 124 | agi = (xfs_agi_t *)p; |
9ee7055c | 125 | printf(_(" AGI Buffer: (XAGI)\n")); |
f8149110 | 126 | if (!print_buffer) |
5e656dbb | 127 | continue; |
9ee7055c | 128 | printf(_(" ver:%d "), |
5e656dbb | 129 | be32_to_cpu(agi->agi_versionnum)); |
9ee7055c | 130 | printf(_("seq#:%d len:%d cnt:%d root:%d\n"), |
5e656dbb BN |
131 | be32_to_cpu(agi->agi_seqno), |
132 | be32_to_cpu(agi->agi_length), | |
133 | be32_to_cpu(agi->agi_count), | |
134 | be32_to_cpu(agi->agi_root)); | |
9ee7055c | 135 | printf(_(" level:%d free#:0x%x newino:0x%x\n"), |
5e656dbb BN |
136 | be32_to_cpu(agi->agi_level), |
137 | be32_to_cpu(agi->agi_freecount), | |
138 | be32_to_cpu(agi->agi_newino)); | |
a59111c1 DC |
139 | if (len == 128) { |
140 | buckets = 17; | |
141 | } else if (len == 256) { | |
142 | buckets = 32 + 17; | |
143 | } else { | |
144 | buckets = XFS_AGI_UNLINKED_BUCKETS; | |
145 | } | |
146 | for (bucket = 0; bucket < buckets;) { | |
147 | int col; | |
148 | printf(_("bucket[%d - %d]: "), bucket, bucket+3); | |
149 | for (col = 0; col < 4; col++, bucket++) { | |
150 | if (bucket < buckets) { | |
151 | printf("0x%x ", | |
152 | be32_to_cpu(agi->agi_unlinked[bucket])); | |
153 | } | |
154 | } | |
155 | printf("\n"); | |
156 | } | |
5e656dbb | 157 | } else if (be32_to_cpu(*(__be32 *)p) == XFS_AGF_MAGIC) { |
2bd0ea18 | 158 | agf = (xfs_agf_t *)p; |
9ee7055c | 159 | printf(_(" AGF Buffer: (XAGF)\n")); |
f8149110 | 160 | if (!print_buffer) |
5e656dbb | 161 | continue; |
9ee7055c | 162 | printf(_(" ver:%d seq#:%d len:%d \n"), |
5e656dbb BN |
163 | be32_to_cpu(agf->agf_versionnum), |
164 | be32_to_cpu(agf->agf_seqno), | |
165 | be32_to_cpu(agf->agf_length)); | |
9ee7055c | 166 | printf(_(" root BNO:%d CNT:%d\n"), |
5e656dbb BN |
167 | be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNOi]), |
168 | be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNTi])); | |
9ee7055c | 169 | printf(_(" level BNO:%d CNT:%d\n"), |
5e656dbb BN |
170 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNOi]), |
171 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNTi])); | |
9ee7055c AM |
172 | printf(_(" 1st:%d last:%d cnt:%d " |
173 | "freeblks:%d longest:%d\n"), | |
5e656dbb BN |
174 | be32_to_cpu(agf->agf_flfirst), |
175 | be32_to_cpu(agf->agf_fllast), | |
176 | be32_to_cpu(agf->agf_flcount), | |
177 | be32_to_cpu(agf->agf_freeblks), | |
178 | be32_to_cpu(agf->agf_longest)); | |
2bd0ea18 NS |
179 | } else if (*(uint *)p == XFS_DQUOT_MAGIC) { |
180 | ddq = (xfs_disk_dquot_t *)p; | |
9ee7055c | 181 | printf(_(" DQUOT Buffer:\n")); |
f8149110 | 182 | if (!print_buffer) |
5e656dbb | 183 | continue; |
9ee7055c | 184 | printf(_(" UIDs 0x%lx-0x%lx\n"), |
5e656dbb BN |
185 | (unsigned long)be32_to_cpu(ddq->d_id), |
186 | (unsigned long)be32_to_cpu(ddq->d_id) + | |
2bd0ea18 NS |
187 | (BBTOB(f->blf_len) / sizeof(xfs_dqblk_t)) - 1); |
188 | } else { | |
9ee7055c | 189 | printf(_(" BUF DATA\n")); |
2bd0ea18 NS |
190 | if (!print_buffer) continue; |
191 | xlog_recover_print_data(p, len); | |
192 | } | |
193 | } | |
15c81278 | 194 | } |
2bd0ea18 NS |
195 | |
196 | STATIC void | |
197 | xlog_recover_print_quotaoff( | |
15c81278 | 198 | xlog_recover_item_t *item) |
2bd0ea18 | 199 | { |
15c81278 | 200 | xfs_qoff_logformat_t *qoff_f; |
6af9d3ef | 201 | char str[32] = { 0 }; |
2bd0ea18 NS |
202 | |
203 | qoff_f = (xfs_qoff_logformat_t *)item->ri_buf[0].i_addr; | |
204 | ASSERT(qoff_f); | |
dfc130f3 | 205 | if (qoff_f->qf_flags & XFS_UQUOTA_ACCT) |
6af9d3ef | 206 | strcat(str, "USER QUOTA"); |
b36eef04 NS |
207 | if (qoff_f->qf_flags & XFS_GQUOTA_ACCT) |
208 | strcat(str, "GROUP QUOTA"); | |
6af9d3ef NS |
209 | if (qoff_f->qf_flags & XFS_PQUOTA_ACCT) |
210 | strcat(str, "PROJECT QUOTA"); | |
9ee7055c | 211 | printf(_("\tQUOTAOFF: #regs:%d type:%s\n"), |
2bd0ea18 NS |
212 | qoff_f->qf_size, str); |
213 | } | |
214 | ||
2bd0ea18 NS |
215 | STATIC void |
216 | xlog_recover_print_dquot( | |
15c81278 | 217 | xlog_recover_item_t *item) |
2bd0ea18 | 218 | { |
dfc130f3 | 219 | xfs_dq_logformat_t *f; |
2bd0ea18 NS |
220 | xfs_disk_dquot_t *d; |
221 | ||
222 | f = (xfs_dq_logformat_t *)item->ri_buf[0].i_addr; | |
223 | ASSERT(f); | |
224 | ASSERT(f->qlf_len == 1); | |
225 | d = (xfs_disk_dquot_t *)item->ri_buf[1].i_addr; | |
9ee7055c | 226 | printf(_("\tDQUOT: #regs:%d blkno:%lld boffset:%u id: %d\n"), |
5b64e00a | 227 | f->qlf_size, (long long)f->qlf_blkno, f->qlf_boffset, f->qlf_id); |
2bd0ea18 NS |
228 | if (!print_quota) |
229 | return; | |
9ee7055c | 230 | printf(_("\t\tmagic 0x%x\tversion 0x%x\tID 0x%x (%d)\t\n"), |
5e656dbb BN |
231 | be16_to_cpu(d->d_magic), |
232 | d->d_version, | |
233 | be32_to_cpu(d->d_id), | |
234 | be32_to_cpu(d->d_id)); | |
9ee7055c AM |
235 | printf(_("\t\tblk_hard 0x%x\tblk_soft 0x%x\tino_hard 0x%x" |
236 | "\tino_soft 0x%x\n"), | |
5e656dbb BN |
237 | (int)be64_to_cpu(d->d_blk_hardlimit), |
238 | (int)be64_to_cpu(d->d_blk_softlimit), | |
239 | (int)be64_to_cpu(d->d_ino_hardlimit), | |
240 | (int)be64_to_cpu(d->d_ino_softlimit)); | |
9ee7055c | 241 | printf(_("\t\tbcount 0x%x (%d) icount 0x%x (%d)\n"), |
5e656dbb BN |
242 | (int)be64_to_cpu(d->d_bcount), |
243 | (int)be64_to_cpu(d->d_bcount), | |
244 | (int)be64_to_cpu(d->d_icount), | |
245 | (int)be64_to_cpu(d->d_icount)); | |
9ee7055c | 246 | printf(_("\t\tbtimer 0x%x itimer 0x%x \n"), |
5e656dbb BN |
247 | (int)be32_to_cpu(d->d_btimer), |
248 | (int)be32_to_cpu(d->d_itimer)); | |
2bd0ea18 NS |
249 | } |
250 | ||
251 | STATIC void | |
252 | xlog_recover_print_inode_core( | |
138659f1 | 253 | struct xfs_log_dinode *di) |
2bd0ea18 | 254 | { |
9ee7055c | 255 | printf(_(" CORE inode:\n")); |
2bd0ea18 NS |
256 | if (!print_inode) |
257 | return; | |
f089fc42 | 258 | printf(_(" magic:%c%c mode:0x%x ver:%d format:%d\n"), |
dfc130f3 | 259 | (di->di_magic>>8) & 0xff, di->di_magic & 0xff, |
f089fc42 | 260 | di->di_mode, di->di_version, di->di_format); |
138659f1 DC |
261 | printf(_(" uid:%d gid:%d nlink:%d projid:0x%04x%04x\n"), |
262 | di->di_uid, di->di_gid, di->di_nlink, | |
263 | di->di_projid_hi, di->di_projid_lo); | |
9ee7055c | 264 | printf(_(" atime:%d mtime:%d ctime:%d\n"), |
2bd0ea18 | 265 | di->di_atime.t_sec, di->di_mtime.t_sec, di->di_ctime.t_sec); |
9ee7055c AM |
266 | printf(_(" flushiter:%d\n"), di->di_flushiter); |
267 | printf(_(" size:0x%llx nblks:0x%llx exsize:%d " | |
268 | "nextents:%d anextents:%d\n"), (unsigned long long) | |
5b64e00a NS |
269 | di->di_size, (unsigned long long)di->di_nblocks, |
270 | di->di_extsize, di->di_nextents, (int)di->di_anextents); | |
9ee7055c | 271 | printf(_(" forkoff:%d dmevmask:0x%x dmstate:%d flags:0x%x " |
3c84c543 | 272 | "gen:%u\n"), |
2bd0ea18 NS |
273 | (int)di->di_forkoff, di->di_dmevmask, (int)di->di_dmstate, |
274 | (int)di->di_flags, di->di_gen); | |
1fe708d6 DW |
275 | if (di->di_version == 3) { |
276 | printf(_("flags2 0x%llx cowextsize 0x%x\n"), | |
277 | (unsigned long long)di->di_flags2, di->di_cowextsize); | |
278 | } | |
15c81278 | 279 | } |
2bd0ea18 NS |
280 | |
281 | STATIC void | |
282 | xlog_recover_print_inode( | |
15c81278 | 283 | xlog_recover_item_t *item) |
2bd0ea18 | 284 | { |
299173ff | 285 | xfs_inode_log_format_t f_buf; |
2bd0ea18 NS |
286 | xfs_inode_log_format_t *f; |
287 | int attr_index; | |
288 | int hasdata; | |
289 | int hasattr; | |
290 | ||
87daa553 DC |
291 | ASSERT(item->ri_buf[0].i_len == sizeof(struct xfs_inode_log_format_32) || |
292 | item->ri_buf[0].i_len == sizeof(struct xfs_inode_log_format)); | |
299173ff TS |
293 | f = xfs_inode_item_format_convert(item->ri_buf[0].i_addr, item->ri_buf[0].i_len, &f_buf); |
294 | ||
9ee7055c | 295 | printf(_(" INODE: #regs:%d ino:0x%llx flags:0x%x dsize:%d\n"), |
5b64e00a NS |
296 | f->ilf_size, (unsigned long long)f->ilf_ino, f->ilf_fields, |
297 | f->ilf_dsize); | |
2bd0ea18 NS |
298 | |
299 | /* core inode comes 2nd */ | |
138659f1 DC |
300 | ASSERT(item->ri_buf[1].i_len == xfs_log_dinode_size(2) || |
301 | item->ri_buf[1].i_len == xfs_log_dinode_size(3)); | |
302 | xlog_recover_print_inode_core((struct xfs_log_dinode *) | |
2bd0ea18 NS |
303 | item->ri_buf[1].i_addr); |
304 | ||
305 | hasdata = (f->ilf_fields & XFS_ILOG_DFORK) != 0; | |
306 | hasattr = (f->ilf_fields & XFS_ILOG_AFORK) != 0; | |
307 | /* does anything come next */ | |
15c81278 NS |
308 | switch (f->ilf_fields & (XFS_ILOG_DFORK|XFS_ILOG_DEV|XFS_ILOG_UUID)) { |
309 | case XFS_ILOG_DEXT: | |
310 | ASSERT(f->ilf_size == 3 + hasattr); | |
9ee7055c | 311 | printf(_(" DATA FORK EXTENTS inode data:\n")); |
15c81278 NS |
312 | if (print_inode && print_data) |
313 | xlog_recover_print_data(item->ri_buf[2].i_addr, | |
314 | item->ri_buf[2].i_len); | |
315 | break; | |
316 | case XFS_ILOG_DBROOT: | |
317 | ASSERT(f->ilf_size == 3 + hasattr); | |
9ee7055c | 318 | printf(_(" DATA FORK BTREE inode data:\n")); |
15c81278 NS |
319 | if (print_inode && print_data) |
320 | xlog_recover_print_data(item->ri_buf[2].i_addr, | |
321 | item->ri_buf[2].i_len); | |
322 | break; | |
323 | case XFS_ILOG_DDATA: | |
324 | ASSERT(f->ilf_size == 3 + hasattr); | |
9ee7055c | 325 | printf(_(" DATA FORK LOCAL inode data:\n")); |
15c81278 NS |
326 | if (print_inode && print_data) |
327 | xlog_recover_print_data(item->ri_buf[2].i_addr, | |
328 | item->ri_buf[2].i_len); | |
329 | break; | |
330 | case XFS_ILOG_DEV: | |
331 | ASSERT(f->ilf_size == 2 + hasattr); | |
9ee7055c | 332 | printf(_(" DEV inode: no extra region\n")); |
15c81278 NS |
333 | break; |
334 | case XFS_ILOG_UUID: | |
335 | ASSERT(f->ilf_size == 2 + hasattr); | |
9ee7055c | 336 | printf(_(" UUID inode: no extra region\n")); |
15c81278 NS |
337 | break; |
338 | ||
339 | case 0: | |
340 | ASSERT(f->ilf_size == 2 + hasattr); | |
341 | break; | |
342 | default: | |
343 | xlog_panic("xlog_print_trans_inode: illegal inode type"); | |
2bd0ea18 NS |
344 | } |
345 | ||
346 | if (hasattr) { | |
347 | attr_index = 2 + hasdata; | |
348 | switch (f->ilf_fields & XFS_ILOG_AFORK) { | |
15c81278 NS |
349 | case XFS_ILOG_AEXT: |
350 | ASSERT(f->ilf_size == 3 + hasdata); | |
9ee7055c | 351 | printf(_(" ATTR FORK EXTENTS inode data:\n")); |
15c81278 NS |
352 | if (print_inode && print_data) |
353 | xlog_recover_print_data( | |
354 | item->ri_buf[attr_index].i_addr, | |
355 | item->ri_buf[attr_index].i_len); | |
356 | break; | |
357 | case XFS_ILOG_ABROOT: | |
358 | ASSERT(f->ilf_size == 3 + hasdata); | |
9ee7055c | 359 | printf(_(" ATTR FORK BTREE inode data:\n")); |
15c81278 NS |
360 | if (print_inode && print_data) |
361 | xlog_recover_print_data( | |
362 | item->ri_buf[attr_index].i_addr, | |
363 | item->ri_buf[attr_index].i_len); | |
364 | break; | |
365 | case XFS_ILOG_ADATA: | |
366 | ASSERT(f->ilf_size == 3 + hasdata); | |
9ee7055c | 367 | printf(_(" ATTR FORK LOCAL inode data:\n")); |
15c81278 NS |
368 | if (print_inode && print_data) |
369 | xlog_recover_print_data( | |
370 | item->ri_buf[attr_index].i_addr, | |
371 | item->ri_buf[attr_index].i_len); | |
372 | break; | |
373 | default: | |
374 | xlog_panic("%s: illegal inode log flag", __FUNCTION__); | |
2bd0ea18 NS |
375 | } |
376 | } | |
15c81278 | 377 | } |
2bd0ea18 | 378 | |
2bd0ea18 | 379 | |
2e6b5c91 DC |
380 | STATIC void |
381 | xlog_recover_print_icreate( | |
382 | struct xlog_recover_item *item) | |
383 | { | |
384 | struct xfs_icreate_log *icl; | |
385 | ||
386 | icl = (struct xfs_icreate_log *)item->ri_buf[0].i_addr; | |
387 | ||
388 | printf(_(" ICR: #ag: %d agbno: 0x%x len: %d\n" | |
389 | " cnt: %d isize: %d gen: 0x%x\n"), | |
390 | be32_to_cpu(icl->icl_ag), be32_to_cpu(icl->icl_agbno), | |
391 | be32_to_cpu(icl->icl_length), be32_to_cpu(icl->icl_count), | |
392 | be32_to_cpu(icl->icl_isize), be32_to_cpu(icl->icl_gen)); | |
393 | } | |
394 | ||
2bd0ea18 NS |
395 | void |
396 | xlog_recover_print_logitem( | |
15c81278 | 397 | xlog_recover_item_t *item) |
2bd0ea18 NS |
398 | { |
399 | switch (ITEM_TYPE(item)) { | |
15c81278 | 400 | case XFS_LI_BUF: |
15c81278 NS |
401 | xlog_recover_print_buffer(item); |
402 | break; | |
2e6b5c91 DC |
403 | case XFS_LI_ICREATE: |
404 | xlog_recover_print_icreate(item); | |
405 | break; | |
15c81278 | 406 | case XFS_LI_INODE: |
15c81278 NS |
407 | xlog_recover_print_inode(item); |
408 | break; | |
409 | case XFS_LI_EFD: | |
410 | xlog_recover_print_efd(item); | |
411 | break; | |
412 | case XFS_LI_EFI: | |
413 | xlog_recover_print_efi(item); | |
414 | break; | |
4428538d DW |
415 | case XFS_LI_RUD: |
416 | xlog_recover_print_rud(item); | |
417 | break; | |
418 | case XFS_LI_RUI: | |
419 | xlog_recover_print_rui(item); | |
420 | break; | |
77e3149e DW |
421 | case XFS_LI_CUD: |
422 | xlog_recover_print_cud(item); | |
423 | break; | |
424 | case XFS_LI_CUI: | |
425 | xlog_recover_print_cui(item); | |
426 | break; | |
dc4957df DW |
427 | case XFS_LI_BUD: |
428 | xlog_recover_print_bud(item); | |
429 | break; | |
430 | case XFS_LI_BUI: | |
431 | xlog_recover_print_bui(item); | |
432 | break; | |
15c81278 NS |
433 | case XFS_LI_DQUOT: |
434 | xlog_recover_print_dquot(item); | |
435 | break; | |
436 | case XFS_LI_QUOTAOFF: | |
437 | xlog_recover_print_quotaoff(item); | |
438 | break; | |
439 | default: | |
9ee7055c | 440 | printf(_("xlog_recover_print_logitem: illegal type\n")); |
15c81278 | 441 | break; |
2bd0ea18 | 442 | } |
15c81278 | 443 | } |
2bd0ea18 NS |
444 | |
445 | void | |
15c81278 NS |
446 | xlog_recover_print_item( |
447 | xlog_recover_item_t *item) | |
2bd0ea18 | 448 | { |
15c81278 | 449 | int i; |
2bd0ea18 NS |
450 | |
451 | switch (ITEM_TYPE(item)) { | |
15c81278 | 452 | case XFS_LI_BUF: |
2bd0ea18 NS |
453 | printf("BUF"); |
454 | break; | |
2e6b5c91 DC |
455 | case XFS_LI_ICREATE: |
456 | printf("ICR"); | |
457 | break; | |
15c81278 | 458 | case XFS_LI_INODE: |
2bd0ea18 NS |
459 | printf("INO"); |
460 | break; | |
15c81278 | 461 | case XFS_LI_EFD: |
2bd0ea18 NS |
462 | printf("EFD"); |
463 | break; | |
15c81278 | 464 | case XFS_LI_EFI: |
2bd0ea18 NS |
465 | printf("EFI"); |
466 | break; | |
4428538d DW |
467 | case XFS_LI_RUD: |
468 | printf("RUD"); | |
469 | break; | |
470 | case XFS_LI_RUI: | |
471 | printf("RUI"); | |
472 | break; | |
77e3149e DW |
473 | case XFS_LI_CUD: |
474 | printf("CUD"); | |
475 | break; | |
476 | case XFS_LI_CUI: | |
477 | printf("CUI"); | |
478 | break; | |
dc4957df DW |
479 | case XFS_LI_BUD: |
480 | printf("BUD"); | |
481 | break; | |
482 | case XFS_LI_BUI: | |
483 | printf("BUI"); | |
484 | break; | |
15c81278 | 485 | case XFS_LI_DQUOT: |
2bd0ea18 NS |
486 | printf("DQ "); |
487 | break; | |
15c81278 | 488 | case XFS_LI_QUOTAOFF: |
2bd0ea18 NS |
489 | printf("QOFF"); |
490 | break; | |
15c81278 | 491 | default: |
9ee7055c | 492 | cmn_err(CE_PANIC, _("%s: illegal type"), __FUNCTION__); |
2bd0ea18 | 493 | break; |
2bd0ea18 NS |
494 | } |
495 | ||
496 | /* type isn't filled in yet | |
9ee7055c | 497 | printf(_("ITEM: type: %d cnt: %d total: %d "), |
2bd0ea18 NS |
498 | item->ri_type, item->ri_cnt, item->ri_total); |
499 | */ | |
9ee7055c | 500 | printf(_(": cnt:%d total:%d "), item->ri_cnt, item->ri_total); |
2bd0ea18 | 501 | for (i=0; i<item->ri_cnt; i++) { |
9ee7055c | 502 | printf(_("a:0x%lx len:%d "), |
5b64e00a | 503 | (long)item->ri_buf[i].i_addr, item->ri_buf[i].i_len); |
2bd0ea18 NS |
504 | } |
505 | printf("\n"); | |
506 | xlog_recover_print_logitem(item); | |
15c81278 | 507 | } |
2bd0ea18 NS |
508 | |
509 | void | |
15c81278 NS |
510 | xlog_recover_print_trans( |
511 | xlog_recover_t *trans, | |
c40bdaa2 | 512 | struct list_head *itemq, |
15c81278 | 513 | int print) |
2bd0ea18 | 514 | { |
c40bdaa2 | 515 | xlog_recover_item_t *item; |
2bd0ea18 NS |
516 | |
517 | if (print < 3) | |
518 | return; | |
519 | ||
dfc130f3 | 520 | print_xlog_record_line(); |
2bd0ea18 | 521 | xlog_recover_print_trans_head(trans); |
c40bdaa2 | 522 | list_for_each_entry(item, itemq, ri_list) |
2bd0ea18 | 523 | xlog_recover_print_item(item); |
15c81278 | 524 | } |