- msg("Added inode %u to exclude list\n", ino);
- iexclude_list[iexclude_num++] = ino;
+ msg("Excluding inode %u from dump\n", ino);
+ }
+
+ /* check for enough mem; initialize */
+ if ((ino/8 + 1) > iexclude_bitmap_bytes) {
+ if (iexclude_bitmap_bytes == 0) {
+ unsigned int j;
+ iexclude_bitmap_bytes = 2 * (ino/8 + 1);
+ iexclude_bitmap = (char*) malloc(iexclude_bitmap_bytes);
+ if (iexclude_bitmap == NULL) {
+ msg("allocating memory failed\n");
+ exit(X_STARTUP);
+ }
+ for (j = 0; j < iexclude_bitmap_bytes; j++)
+ iexclude_bitmap[j] = 0;
+ }
+ else {
+ unsigned int oldsize = iexclude_bitmap_bytes;
+ iexclude_bitmap_bytes *=
+ (ino / 8 + 1) / iexclude_bitmap_bytes + 1;
+ iexclude_bitmap = (char*) realloc(iexclude_bitmap,
+ iexclude_bitmap_bytes);
+ if (iexclude_bitmap == NULL) {
+ msg("allocating memory failed\n");
+ exit(X_STARTUP);
+ }
+ for( ; oldsize < iexclude_bitmap_bytes; oldsize++)
+ iexclude_bitmap[oldsize] = 0;
+ }