]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - logprint/log_print_trans.c
apply gettext translation to more strings
[thirdparty/xfsprogs-dev.git] / logprint / log_print_trans.c
CommitLineData
2bd0ea18 1/*
da23017d
NS
2 * Copyright (c) 2000-2001,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
NS
17 */
18
19#include "logprint.h"
20
21void
22xlog_recover_print_trans_head(
72c5917e 23 xlog_recover_t *tr)
2bd0ea18 24{
9ee7055c 25 printf(_("TRANS: tid:0x%x type:%s #items:%d trans:0x%x q:0x%lx\n"),
dfc130f3
RC
26 tr->r_log_tid, trans_type[tr->r_theader.th_type],
27 tr->r_theader.th_num_items,
28 tr->r_theader.th_tid, (long)tr->r_itemq);
72c5917e 29}
2bd0ea18
NS
30
31int
72c5917e
NS
32xlog_recover_do_trans(
33 xlog_t *log,
34 xlog_recover_t *trans,
35 int pass)
2bd0ea18
NS
36{
37 xlog_recover_print_trans(trans, trans->r_itemq, 3);
38 return 0;
72c5917e 39}
2bd0ea18
NS
40
41void
72c5917e
NS
42xfs_log_print_trans(
43 xlog_t *log,
44 int print_block_start)
2bd0ea18
NS
45{
46 xfs_daddr_t head_blk, tail_blk;
dc0bd4a0 47 int error;
2bd0ea18 48
5e656dbb
BN
49 error = xlog_find_tail(log, &head_blk, &tail_blk);
50 if (error) {
9ee7055c 51 fprintf(stderr, _("%s: failed to find head and tail, error: %d\n"),
dc0bd4a0 52 progname, error);
72c5917e 53 exit(1);
dc0bd4a0 54 }
dfc130f3 55
9ee7055c 56 printf(_(" log tail: %lld head: %lld state: %s\n"),
dfc130f3
RC
57 (long long)tail_blk,
58 (long long)head_blk,
59 (tail_blk == head_blk)?"<CLEAN>":"<DIRTY>");
60
61 if (print_block_start != -1) {
9ee7055c 62 printf(_(" override tail: %d\n"), print_block_start);
72c5917e 63 tail_blk = print_block_start;
dfc130f3
RC
64 }
65 printf("\n");
66
72c5917e 67 print_record_header = 1;
2bd0ea18 68
72c5917e
NS
69 if (head_blk == tail_blk)
70 return;
dc0bd4a0 71 if ((error = xlog_do_recovery_pass(log, head_blk, tail_blk, XLOG_RECOVER_PASS1))) {
9ee7055c 72 fprintf(stderr, _("%s: failed in xfs_do_recovery_pass, error: %d\n"),
dc0bd4a0 73 progname, error);
72c5917e 74 exit(1);
dc0bd4a0 75 }
72c5917e 76}