20 if (hpfs_sb(s)->sb_chk)
if (bmp_block * 16384 > hpfs_sb(s)->sb_fs_size) {
21 hpfs_error(s,
"hpfs_map_bitmap called with bad parameter: %08x at %s", bmp_block,
id);
24 sec =
le32_to_cpu(hpfs_sb(s)->sb_bmp_dir[bmp_block]);
25 if (!sec || sec > hpfs_sb(s)->sb_fs_size-4) {
26 hpfs_error(s,
"invalid bitmap block pointer %08x -> %08x at %s", bmp_block, sec,
id);
40 struct buffer_head *bh;
44 unsigned char *cp_table;
55 printk(
"HPFS: n_code_pages == 0\n");
64 printk(
"HPFS: Code page index out of array\n");
70 printk(
"HPFS: Code page index out of sector\n");
76 printk(
"HPFS: out of memory for code page table\n");
80 memcpy(cp_table, ptr, 128);
85 for (i=128; i<256; i++) cp_table[i]=i;
86 for (i=128; i<256; i++)
if (cp_table[i-128]!=i && cp_table[i-128]>=128)
87 cp_table[cp_table[i-128]] =
i;
94 struct buffer_head *bh;
95 int n = (hpfs_sb(s)->sb_fs_size + 0x200000 - 1) >> 21;
99 printk(
"HPFS: can't allocate memory for bitmap directory\n");
108 memcpy((
char *)b + 512 * i, d, 512);
125 if (hpfs_sb(s)->sb_chk) {
133 if (!fnode_is_dir(fnode)) {
134 if ((
unsigned)fnode->
btree.n_used_nodes + (
unsigned)fnode->
btree.n_free_nodes !=
135 (bp_internal(&fnode->
btree) ? 12 : 8)) {
137 "bad number of nodes in fnode %08lx",
142 8 + fnode->
btree.n_used_nodes * (bp_internal(&fnode->
btree) ? 8 : 12)) {
144 "bad first_free pointer in fnode %08lx",
152 "bad EA info in fnode %08lx: ea_offs == %04x ea_size_s == %04x",
157 ea = fnode_ea(fnode);
158 ea_end = fnode_end_ea(fnode);
159 while (ea != ea_end) {
180 if (hpfs_sb(s)->sb_chk) {
182 hpfs_error(s,
"bad magic on anode %08x", ano);
186 hpfs_error(s,
"self pointer invalid on anode %08x", ano);
189 if ((
unsigned)anode->
btree.n_used_nodes + (
unsigned)anode->
btree.n_free_nodes !=
190 (bp_internal(&anode->
btree) ? 60 : 40)) {
191 hpfs_error(s,
"bad number of nodes in anode %08x", ano);
195 8 + anode->
btree.n_used_nodes * (bp_internal(&anode->
btree) ? 8 : 12)) {
196 hpfs_error(s,
"bad first_free pointer in anode %08x", ano);
214 if (hpfs_sb(s)->sb_chk) {
217 hpfs_error(s,
"dnode %08x not byte-aligned", secno);
222 if (hpfs_sb(s)->sb_chk) {
224 unsigned char *
d = (
unsigned char *)dnode;
227 hpfs_error(s,
"bad magic on dnode %08x", secno);
241 hpfs_error(s,
"bad dirent size in dnode %08x, dirent %03x, last %03x", secno, p, pp);
246 hpfs_error(s,
"namelen does not match dirent size in dnode %08x, dirent %03x, last %03x", secno, p, pp);
250 if (hpfs_sb(s)->sb_chk >= 2) b |= 1 << de->
down;
251 if (de->
down)
if (de_down_pointer(de) < 0x10) {
252 hpfs_error(s,
"bad down pointer in dnode %08x, dirent %03x, last %03x", secno, p, pp);
259 hpfs_error(s,
"size on last dirent does not match first_free; dnode %08x", secno);
262 if (d[pp + 30] != 1 || d[pp + 31] != 255) {
263 hpfs_error(s,
"dnode %08x does not end with \\377 entry", secno);
266 if (b == 3)
printk(
"HPFS: warning: unbalanced dnode tree, dnode %08x; see hpfs.txt 4 more info\n", secno);
276 struct buffer_head *bh;