1 --- convertfs/devremap.c 2002-03-01 16:16:45.000000000 +0100
2 +++ convertfs2005/devremap.c 2005-09-30 15:57:24.000000000 +0200
12 static struct superblock super;
13 static struct info info;
16 +/* ULTRA UGLY HACK */
17 +struct indexpage *hack_ip;
18 +struct chunk *hack_chunk = NULL;
25 die (const char *format, ...)
31 +/* printf("find_cross_block\n"); */
33 + if(hack_chunk != NULL)
35 + if ((*hack_physp == bm->to) && (*hack_physp != hack_virt))
44 + goto VERY_UGLY_HACK;
50 for (ip = bm->ip; ip; ip = ip->next, chunk = ip->chunk)
51 for (; chunk; chunk = next_chunk(ip, chunk), i = 0) {
53 +/* printf("chunk: %p bm->to: %lx\n", chunk, (long int)bm->to); */
55 virt = chunk->offset + i;
56 physp = &chunk->block[i];
57 - for (; i < chunk->nblocks; i++, virt++, physp++)
58 + for (; i < chunk->nblocks; i++, virt++, physp++) {
61 if ((*physp == bm->to) && (*physp != virt)) {
73 + if(hack_i >= chunk->nblocks)
75 + hack_chunk = next_chunk(hack_ip, hack_chunk);
80 + hack_virt = hack_chunk->offset + hack_i;
81 + hack_physp = &hack_chunk->block[hack_i];
85 handle_cross_block(ip, bm, physp, virt);
94 main (int argc, char *argv[])
100 fprintf(stderr, "Usage: %s DEVICE\n", selfname);
111 + printf("...that took %d seconds.\n", (int)(time(NULL)-t));
113 printf("And now the block0...\n");
114 bmove(super.block0, 0);