FreeCalypso > hg > freecalypso-reveng
annotate pirollback/journal.c @ 185:a820d9f9adbf
leo-obj: started analyzing tpudrv.lib objects
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Mon, 11 Aug 2014 21:32:30 +0000 |
parents | 78ac405716db |
children |
rev | line source |
---|---|
46
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 #include <sys/types.h> |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 #include <endian.h> |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 #include <stdio.h> |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 #include <string.h> |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 #include <strings.h> |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 #include <stdlib.h> |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 #include <unistd.h> |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 #include "types.h" |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 #include "struct.h" |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 extern u8 image[0x480000]; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 extern struct inode_info inode[]; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 extern int last_inode; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 extern u8 blank_flash_line[16]; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 int journal_start_ino; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 find_journal() |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 int ino; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 struct inode_info *inf; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 for (ino = 2; ino <= last_inode; ino++) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 inf = inode + ino; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 if (inf->type == 0xE1 && inf->parent == 1 && |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 !strcmp(inf->dataptr, ".journal")) |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 return(ino); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 fprintf(stderr, "error: cannot find /.journal\n"); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 exit(1); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 parse_journal() |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
35 struct inode_info *inf; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
36 struct journal_entry *jr, *endp; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
37 int ino = 0; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
38 u16 tempu16; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
39 s16 temps16; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
40 |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
41 inf = inode + find_journal(); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
42 if (inf->len != 0x4010) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
43 fprintf(stderr, |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
44 "error: /.journal file length differs from expected\n"); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
45 exit(1); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
46 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
47 jr = (struct journal_entry *)(inf->dataptr + 0xC); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
48 for (endp = jr + 0x3FF; jr < endp; jr++) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
49 if (!bcmp(jr, blank_flash_line, 16)) |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
50 break; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
51 if (jr->status != 0xF1) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
52 fprintf(stderr, |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
53 "journal record at %x: status byte != F1\n", |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
54 (u8 *) jr - image); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
55 exit(1); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
56 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
57 tempu16 = le16toh(jr->this_ino); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
58 if (ino) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
59 ino++; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
60 if (ino != tempu16) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
61 fprintf(stderr, |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
62 "journal record at %x: break in inode # sequence\n", |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
63 (u8 *) jr - image); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
64 exit(1); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
65 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
66 } else { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
67 ino = tempu16; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
68 journal_start_ino = ino; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
69 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
70 if (ino < 3 || ino > last_inode) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
71 fprintf(stderr, |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
72 "journal record at %x: inode # out of range\n", |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
73 (u8 *) jr - image); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
74 exit(1); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
75 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
76 inf = inode + ino; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
77 inf->jflash = jr; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
78 if (inf->type) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
79 if (jr->objtype != inf->type) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
80 fprintf(stderr, |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
81 "journal record at %x: type mismatch\n", |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
82 (u8 *) jr - image); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
83 exit(1); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
84 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
85 } else { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
86 switch (jr->objtype) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
87 case 0xE1: |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
88 case 0xF1: |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
89 case 0xF2: |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
90 case 0xF4: |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
91 break; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
92 default: |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
93 fprintf(stderr, |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
94 "journal record at %x: unexpected type byte value\n", |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
95 (u8 *) jr - image); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
96 exit(1); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
97 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
98 inf->type = jr->objtype; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
99 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
100 if (le32toh(jr->location) != inf->rawloc) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
101 fprintf(stderr, |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
102 "journal record at %x: location field mismatch\n", |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
103 (u8 *) jr - image); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
104 exit(1); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
105 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
106 if (le16toh(jr->size) != inf->len) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
107 fprintf(stderr, |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
108 "journal record at %x: size field mismatch\n", |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
109 (u8 *) jr - image); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
110 exit(1); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
111 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
112 temps16 = le16toh(jr->link_ptr); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
113 if (temps16 < -last_inode || temps16 > last_inode) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
114 fprintf(stderr, |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
115 "journal record at %x: linkptr field out of range\n", |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
116 (u8 *) jr - image); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
117 exit(1); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
118 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
119 inf->j_unlink_ptr = temps16; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
120 temps16 = le16toh(jr->replacee); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
121 if (temps16 < 0 || temps16 > last_inode) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
122 fprintf(stderr, |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
123 "journal record at %x: replacee field out of range\n", |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
124 (u8 *) jr - image); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
125 exit(1); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
126 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
127 inf->j_oldver = temps16; |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
128 if (jr->repli) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
129 fprintf(stderr, |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
130 "journal record at %x: last 16-bit word is not zero as expected\n", |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
131 (u8 *) jr - image); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
132 exit(1); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
133 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
134 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
135 if (!ino) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
136 fprintf(stderr, "error: journal is empty!\n"); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
137 exit(1); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
138 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
139 if (ino != last_inode) { |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
140 fprintf(stderr, "error: journal end != inode block end\n"); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
141 exit(1); |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
142 } |
78ac405716db
pirollback: journal parsing implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
143 } |