return ret;
}
+static void progress(void)
+{
+ static uint8_t progct;
+ progct++;
+ progct&=3;
+ printf("%c\010", "-\\|/"[progct]);
+ fflush(stdout);
+}
+
static void bitset(uint16_t b)
{
bitmap[b >> 3] |= (1 << (b & 7));
to keep both bitmap and linkmap around at the same time */
for (n = ROOTINODE; n < max_inode; ++n) {
iread(n, &ino);
+ progress();
linkmap[n] = -1;
if (ino.i_mode == 0)
continue;
}
if (buf[b] != 0)
bitset(buf[b]);
+ progress();
}
}
/* Check the rest */
bmax = ino.i_size/512;
for (bno = 0; bno <= bmax ; ++bno) {
b = getblkno(&ino, bno);
+ progress();
if (b != 0 && (b < superblock.s_isize || b >= superblock.s_fsize)) {
printf("Inode %u block %u out of range, val = %u. Zap? ",
if (superblock.s_nfree == 50) {
dwrite(j, (char *) &superblock.s_nfree);
superblock.s_nfree = 0;
+ progress();
}
superblock.s_tfree++;
superblock.s_free[superblock.s_nfree++] = j;
for (n = ROOTINODE; n < max_inode; ++n) {
iread(n, &ino);
+ progress();
mode = ino.i_mode & F_MASK;
if (mode != F_REG && mode != F_DIR)
destroy them. Be careful */
for (j = 0; j < nentries; ++j) {
dirread(&ino, j, &dentry);
+ progress();
for (i = 0; i < 30; ++i) if (dentry.d_name[i] == '\0') break;
for ( ; i < 30; ++i) dentry.d_name[i] = '\0';
for (n = ROOTINODE; n < max_inode; ++n) {
iread(n, &ino);
+ progress();
if (ino.i_mode == 0) {
if (linkmap[n] != -1)
static uint16_t lblk = 0;
+/* FIXME: we really could do with more buffers on bigger systems (>32K ones) */
static char *daread(uint16_t blk)
{
static char da_buf[512];