2
* Copyright (c) International Business Machines Corp., 2000
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
12
* the GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
* MODULE_NAME: xlogredo.c
20
* COMPONENT_NAME: jfs utilities
38
#include "jfs_types.h"
39
#include "jfs_version.h"
42
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
44
* For message processing in called routines
48
char message_parm_0[64];
49
char message_parm_1[64];
50
char message_parm_2[64];
51
char message_parm_3[64];
52
char message_parm_4[64];
53
char message_parm_5[64];
54
char message_parm_6[64];
55
char message_parm_7[64];
56
char message_parm_8[64];
57
char message_parm_9[64];
59
char *msgprms[10] = { message_parm_0, message_parm_1, message_parm_2,
60
message_parm_3, message_parm_4, message_parm_5,
61
message_parm_6, message_parm_7, message_parm_8,
64
int16_t msgprmidx[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
66
char message_buffer_0[256];
67
char message_buffer_1[1024];
68
char message_buffer_2[1024];
69
char *terse_msg_ptr = &message_buffer_0[0];
70
char *verbose_msg_ptr = &message_buffer_1[0];
71
char *msgs_txt_ptr = &message_buffer_2[0];
72
unsigned long msgs_txt_maxlen = 1024;
74
extern char *MsgText[];
76
extern void fsck_send_msg( int, int, int ); /* defined in fsckmsg.c */
77
extern int alloc_wrksp( uint32_t, int, int, void ** ); /* defined in fsckwsp.c */
83
int main( int argc, char **argv)
89
extern int32_t jfs_logredo(caddr_t, int32_t, int32_t );
91
printf( "logredo version %s, %s\n",
92
VERSION, JFSUTILS_DATE);
95
fprintf (stderr, "Usage: logredo <block device>\n");
101
rc = ujfs_open_device(dev_name, &fd, &Blksize, RDWR_EXCL);
104
fprintf(stderr,"Error: Cannot open device %s, rc = %d.\n",
113
if ( (rc = jfs_logredo(dev_name, fd, 0)) ) {
114
fprintf (stderr, "Failure replaying log: %d\n",rc);