Ignore:
Timestamp:
May 25, 2006, 2:00:37 PM (18 years ago)
Author:
bcornec
Message:

2.08 synced with stable as of r575
VERSION files updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0.8/mondo/mondo/mondorestore/mondo-rstr-tools.c

    r425 r576  
    25852585                                           int wait_for_percentage)
    25862586{
    2587     struct s_mdstat *mdstat;
     2587    struct raidlist_itself *raidlist;
    25882588    int unfinished_mdstat_devices = 9999, i;
    25892589    char *screen_message;
    25902590
    25912591    malloc_string(screen_message);
    2592     mdstat = malloc(sizeof(struct s_mdstat));
     2592    raidlist = malloc(sizeof(struct raidlist_itself));
    25932593
    25942594    assert(wait_for_percentage <= 100);
    25952595    iamhere("Help, my boat is sync'ing. (Get it? Urp! Urp!)");
    25962596    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);
    25992601            return;
    26002602        }
    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) {
    26032605                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);
    26062609                open_evalcall_form(screen_message);
    2607                 if (mdstat->el[i].progress == -1)   // delayed while another partition inits
     2610                if (raidlist->el[i].progress == -1) // delayed while another partition inits
    26082611                {
    26092612                    continue;
    26102613                }
    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);
    26132617                    sleep(2);
    2614                     if (read_mdstat(mdstat, mdstat_file)) {
     2618                    // FIXME: Prefix '/dev/' should really be dynamic!
     2619                    if (parse_mdstat(raidlist, "/dev/")) {
    26152620                        break;
    26162621                    }
     
    26212626    }
    26222627    paranoid_free(screen_message);
    2623     paranoid_free(mdstat);
    2624 }
     2628    paranoid_free(raidlist);
     2629}
Note: See TracChangeset for help on using the changeset viewer.