Changeset 2037


Ignore:
Timestamp:
Oct 7, 2008, 12:12:01 AM (11 years ago)
Author:
bruno
Message:

Remove useless function calc_orig_size_of_drive_from_mountlist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.7/mondo/src/mondorestore/mondo-prep.c

    r2035 r2037  
    25632563
    25642564/**
    2565  * Calculate the probable size of @p drive_name by adding up sizes in
    2566  * @p mountlist.
    2567  * @param mountlist The mountlist to use to calculate the size.
    2568  * @param drive_name The drive to calculate the original size of.
    2569  * @return The size of @p drive_name in kilobytes.
    2570  */
    2571 long calc_orig_size_of_drive_from_mountlist(struct mountlist_itself
    2572                                             *mountlist, char *drive_name)
    2573 {
    2574     /** long ************************************************************/
    2575     long original_size_of_drive;
    2576 
    2577     /** int *************************************************************/
    2578     int partno;
    2579 
    2580     /** buffers *********************************************************/
    2581     char *tmp;
    2582 
    2583     /** end *************************************************************/
    2584 
    2585     malloc_string(tmp);
    2586     assert(mountlist != NULL);
    2587     assert_string_is_neither_NULL_nor_zerolength(drive_name);
    2588 
    2589     for (original_size_of_drive = 0, partno = 0;
    2590          partno < mountlist->entries; partno++) {
    2591         if (strncmp
    2592             (mountlist->el[partno].device, drive_name,
    2593              strlen(drive_name)) == 0) {
    2594             original_size_of_drive += mountlist->el[partno].size;
    2595         } else {
    2596             sprintf(tmp, "Skipping %s", mountlist->el[partno].device);
    2597 //            log_to_screen(tmp);
    2598         }
    2599     }
    2600     original_size_of_drive = original_size_of_drive / 1024;
    2601     paranoid_free(tmp);
    2602     return (original_size_of_drive);
    2603 }
    2604 
    2605 
    2606 /**
    26072565 * Resize a drive's entries in @p mountlist proportionately to fit its new size.
    26082566 * There are a few problems with this function:
     
    26332591    /** long *************************************************************/
    26342592    long newsizL;
    2635     long current_size_of_drive = 0;
    2636     long original_size_of_drive = 0;
     2593    long current_size_of_drive = 0L;
     2594    long original_size_of_drive = 0L;
    26372595    long final_size;            /* all in Megabytes */
    26382596    struct mountlist_reference *drivemntlist;
Note: See TracChangeset for help on using the changeset viewer.