X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=restore%2Futilities.c;h=16d16746fc6b8fdda7b374358adfe1a6b8c89f41;hp=e897344a1e0a85ef5bec3d5f0bdb9aee51fae362;hb=e531c44203905d5554118c09c8d0267f17879ee6;hpb=fe0e02857a1ff7db4bf8cb28780de7ecf2f24234 diff --git a/restore/utilities.c b/restore/utilities.c index e897344..16d1674 100644 --- a/restore/utilities.c +++ b/restore/utilities.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: utilities.c,v 1.20 2002/02/04 11:18:46 stelian Exp $"; + "$Id: utilities.c,v 1.21 2002/11/15 09:25:42 stelian Exp $"; #endif /* not lint */ #include @@ -543,3 +543,25 @@ Inode2Tapepos(dump_ino_t ino, long *tnum, long long *tpos, int exactmatch) return 0; } #endif /* USE_QFA */ + +void resizemaps(dump_ino_t oldmax, dump_ino_t newmax) +{ + char *map; + + if (usedinomap) { + map = calloc((unsigned)1, (unsigned)howmany(newmax, NBBY)); + if (map == NULL) + errx(1, "no memory for active inode map"); + memcpy(map, usedinomap, howmany(oldmax, NBBY)); + free(usedinomap); + usedinomap = map; + } + if (dumpmap) { + map = calloc((unsigned)1, (unsigned)howmany(newmax, NBBY)); + if (map == NULL) + errx(1, "no memory for file dump list"); + memcpy(map, dumpmap, howmany(oldmax, NBBY)); + free(dumpmap); + dumpmap = map; + } +}