]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - logprint/log_print_trans.c
Update copyright dates (again)
[thirdparty/xfsprogs-dev.git] / logprint / log_print_trans.c
1 /*
2 * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 *
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 *
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
25 *
26 * http://www.sgi.com
27 *
28 * For further information regarding this notice, see:
29 *
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31 */
32
33 #include "logprint.h"
34
35 void
36 xlog_recover_print_trans_head(
37 xlog_recover_t *tr)
38 {
39 printf("TRANS: tid:0x%x type:%s #items:%d trans:0x%x q:0x%lx\n",
40 tr->r_log_tid, trans_type[tr->r_theader.th_type],
41 tr->r_theader.th_num_items,
42 tr->r_theader.th_tid, (long)tr->r_itemq);
43 } /* xlog_recover_print_trans_head */
44
45 int
46 xlog_recover_do_trans(xlog_t *log,
47 xlog_recover_t *trans,
48 int pass)
49 {
50 xlog_recover_print_trans(trans, trans->r_itemq, 3);
51 return 0;
52 } /* xlog_recover_do_trans */
53
54
55 void
56 xfs_log_print_trans(xlog_t *log,
57 int print_block_start)
58 {
59 xfs_daddr_t head_blk, tail_blk;
60
61 if (xlog_find_tail(log, &head_blk, &tail_blk, 0))
62 exit(1);
63
64 printf(" log tail: %lld head: %lld state: %s\n",
65 (long long)tail_blk,
66 (long long)head_blk,
67 (tail_blk == head_blk)?"<CLEAN>":"<DIRTY>");
68
69 if (print_block_start != -1) {
70 printf(" override tail: %lld\n",
71 (long long)print_block_start);
72 tail_blk = print_block_start;
73 }
74 printf("\n");
75
76 print_record_header=1;
77 if (xlog_do_recovery_pass(log, head_blk, tail_blk, XLOG_RECOVER_PASS1))
78 exit(1);
79
80 } /* xfs_log_print_trans */