+void
+clean_dump(void)
+{
+ DUMP_ITEM *item, *before;
+
+ /* check if the maxpart part is avaliable */
+ for(item = disk_hist, before = NULL; item;
+ before = item, item = item->next) {
+ int found_maxpart = 0;
+ tapelist_t *cur_tape;
+
+ if (item->maxpart > 1) {
+ for (cur_tape = item->tapes; cur_tape; cur_tape = cur_tape->next) {
+ int files;
+ for(files=0; files<cur_tape->numfiles; files++) {
+ if (cur_tape->partnum[files] == item->maxpart) {
+ found_maxpart = 1;
+ }
+ }
+ }
+ if (found_maxpart == 0) {
+ DUMP_ITEM *myitem = item;
+
+ if (before)
+ before->next = item->next;
+ else
+ disk_hist = item->next;
+ item = item->next;
+ /* free myitem */
+ free_tapelist(myitem->tapes);
+ amfree(myitem->hostname);
+ amfree(myitem);
+ if (item == NULL)
+ break;
+ }
+ }
+ }
+}