Changeset 558 in MondoRescue for branches/stable/mondo/mondo/mondorestore/mondo-rstr-tools.c
- Timestamp:
- May 20, 2006, 4:54:20 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/mondo/mondorestore/mondo-rstr-tools.c
r541 r558 2585 2585 int wait_for_percentage) 2586 2586 { 2587 struct s_mdstat *mdstat;2587 struct raidlist_itself *raidlist; 2588 2588 int unfinished_mdstat_devices = 9999, i; 2589 2589 char *screen_message; 2590 2590 2591 2591 malloc_string(screen_message); 2592 mdstat = malloc(sizeof(struct s_mdstat));2592 raidlist = malloc(sizeof(struct raidlist_itself)); 2593 2593 2594 2594 assert(wait_for_percentage <= 100); 2595 2595 iamhere("Help, my boat is sync'ing. (Get it? Urp! Urp!)"); 2596 2596 while (unfinished_mdstat_devices > 0) { 2597 if (read_mdstat(mdstat, mdstat_file)) { 2598 log_to_screen("Sorry, cannot read %s", mdstat_file); 2597 // FIXME: Prefix '/dev/' should really be dynamic! 2598 if (parse_mdstat(raidlist, "/dev/")) { 2599 log_to_screen("Sorry, cannot read %s", MDSTAT_FILE); 2600 log_msg(1,"Sorry, cannot read %s", MDSTAT_FILE); 2599 2601 return; 2600 2602 } 2601 for (unfinished_mdstat_devices = i = 0; i < mdstat->entries; i++) {2602 if ( mdstat->el[i].progress < wait_for_percentage) {2603 for (unfinished_mdstat_devices = i = 0; i <= raidlist->entries; i++) { 2604 if (raidlist->el[i].progress < wait_for_percentage) { 2603 2605 unfinished_mdstat_devices++; 2604 sprintf(screen_message, "Sync'ing /dev/md%d", 2605 mdstat->el[i].md); 2606 log_msg(1,"Sync'ing %s (i=%d)", raidlist->el[i].raid_device, i); 2607 sprintf(screen_message, "Sync'ing %s", 2608 raidlist->el[i].raid_device); 2606 2609 open_evalcall_form(screen_message); 2607 if ( mdstat->el[i].progress == -1) // delayed while another partition inits2610 if (raidlist->el[i].progress == -1) // delayed while another partition inits 2608 2611 { 2609 2612 continue; 2610 2613 } 2611 while (mdstat->el[i].progress < wait_for_percentage) { 2612 update_evalcall_form(mdstat->el[i].progress); 2614 while (raidlist->el[i].progress < wait_for_percentage) { 2615 log_msg(1,"Percentage sync'ed: %d", raidlist->el[i].progress); 2616 update_evalcall_form(raidlist->el[i].progress); 2613 2617 sleep(2); 2614 if (read_mdstat(mdstat, mdstat_file)) { 2618 // FIXME: Prefix '/dev/' should really be dynamic! 2619 if (parse_mdstat(raidlist, "/dev/")) { 2615 2620 break; 2616 2621 } … … 2621 2626 } 2622 2627 paranoid_free(screen_message); 2623 paranoid_free( mdstat);2624 } 2628 paranoid_free(raidlist); 2629 }
Note:
See TracChangeset
for help on using the changeset viewer.