Ignore:
Timestamp:
Sep 24, 2007, 3:04:43 AM (12 years ago)
Author:
Bruno Cornec
Message:

Render bkpinfo global (potential issue on thread, but should not be a problem as that structure is indeed static during archive)
Should solve the tmpdir issue from previous rev.
May still not compile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mondo/src/common/libmondo-verify.c

    r1644 r1645  
    128128extern char *MONDO_LOGFILE;
    129129
     130/* Reference to global bkpinfo */
     131extern struct s_bkpinfo *bkpinfo;
     132
    130133/**
    131134 * Generate a list of the files that have changed, based on @c afio @c -r
     
    210213 * @return The number of sets containing differences (0 for success).
    211214 */
    212 int verify_afioballs_on_CD(struct s_bkpinfo *bkpinfo, char *mountpoint)
     215int verify_afioballs_on_CD(char *mountpoint)
    213216{
    214217
     
    229232         set_number < 9999
    230233         &&
    231          !does_file_exist(vfy_tball_fname
    232                           (bkpinfo, mountpoint, set_number));
     234         !does_file_exist(vfy_tball_fname(mountpoint, set_number));
    233235         set_number++);
    234     if (!does_file_exist(vfy_tball_fname(bkpinfo, mountpoint, set_number))) {
     236    if (!does_file_exist(vfy_tball_fname(mountpoint, set_number))) {
    235237        return (0);
    236238    }
     
    253255
    254256    for (total_sets = set_number;
    255          does_file_exist(vfy_tball_fname(bkpinfo, mountpoint, total_sets));
     257         does_file_exist(vfy_tball_fname(mountpoint, total_sets));
    256258         total_sets++) {
    257259        log_msg(1, "total_sets = %d", total_sets);
    258260    }
    259261    for (;
    260          does_file_exist(vfy_tball_fname(bkpinfo, mountpoint, set_number));
     262         does_file_exist(vfy_tball_fname(mountpoint, set_number));
    261263         set_number++) {
    262264        percentage =
     
    266268        log_msg(1, "set = %d", set_number);
    267269        retval +=
    268             verify_an_afioball_from_CD(bkpinfo,
    269                                        vfy_tball_fname(bkpinfo, mountpoint,
    270                                                        set_number));
     270            verify_an_afioball_from_CD(vfy_tball_fname(mountpoint, set_number));
    271271    }
    272272    g_last_afioball_number = set_number - 1;
     
    287287 * @return The number of differences (0 for perfect biggiefiles).
    288288 */
    289 int verify_all_slices_on_CD(struct s_bkpinfo *bkpinfo, char *mtpt)
     289int verify_all_slices_on_CD(char *mtpt)
    290290{
    291291
     
    501501 * @return 0, always.
    502502 */
    503 int verify_a_tarball(struct s_bkpinfo *bkpinfo, char *tarball_fname)
     503int verify_a_tarball(char *tarball_fname)
    504504{
    505505    /*@ buffers ********************************************************* */
     
    631631 */
    632632int
    633 verify_an_afioball_from_CD(struct s_bkpinfo *bkpinfo, char *tarball_fname)
     633verify_an_afioball_from_CD(char *tarball_fname)
    634634{
    635635
     
    637637    int res = 0;
    638638
    639     assert(bkpinfo != NULL);
    640639    assert_string_is_neither_NULL_nor_zerolength(tarball_fname);
    641640
     
    644643        fatal_error("Cannot verify nonexistent afioball");
    645644    }
    646     res = verify_a_tarball(bkpinfo, tarball_fname);
     645    res = verify_a_tarball(tarball_fname);
    647646    return (res);
    648647}
     
    659658 */
    660659int
    661 verify_an_afioball_from_stream(struct s_bkpinfo *bkpinfo, char *orig_fname,
    662                                long long size)
     660verify_an_afioball_from_stream(char *orig_fname, long long size)
    663661{
    664662
     
    691689            tarball_fname);
    692690/*  log_it(tmp); */
    693     read_file_from_stream_to_file(bkpinfo, tarball_fname, size);
    694     res = verify_a_tarball(bkpinfo, tarball_fname);
     691    read_file_from_stream_to_file(tarball_fname, size);
     692    res = verify_a_tarball(tarball_fname);
    695693    if (res) {
    696694        sprintf(tmp,
     
    714712 */
    715713int
    716 verify_a_biggiefile_from_stream(struct s_bkpinfo *bkpinfo,
    717                                 char *biggie_fname, long long size)
     714verify_a_biggiefile_from_stream(char *biggie_fname, long long size)
    718715{
    719716
     
    765762            wrong_marker(BLK_START_AN_AFIO_OR_SLICE, ctrl_chr);
    766763        }
    767         res = read_file_from_stream_to_file(bkpinfo, test_file, slice_siz);
     764        res = read_file_from_stream_to_file(test_file, slice_siz);
    768765        unlink(test_file);
    769766        res =
     
    809806 * @return 0 for success (even if there are differences); nonzero for a tape error.
    810807 */
    811 int verify_afioballs_from_stream(struct s_bkpinfo *bkpinfo)
     808int verify_afioballs_from_stream()
    812809{
    813810    /*@ int ********************************************************** */
     
    842839    }
    843840    log_to_screen("Verifying regular archives on tape");
    844     total_afioballs = get_last_filelist_number(bkpinfo) + 1;
     841    total_afioballs = get_last_filelist_number() + 1;
    845842    open_progress_form("Verifying filesystem",
    846843                       "I am verifying archives against your live filesystem now.",
     
    853850        if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) {
    854851            res =
    855                 read_EXAT_files_from_tape(bkpinfo, &size, fname, &ctrl_chr,
     852                read_EXAT_files_from_tape(&size, fname, &ctrl_chr,
    856853                                          curr_xattr_list_fname,
    857854                                          curr_acl_list_fname);
     
    876873            iamhere("Reading EXAT files from tape");
    877874            res =
    878                 read_EXAT_files_from_tape(bkpinfo, &size, fname, &ctrl_chr,
     875                read_EXAT_files_from_tape(&size, fname, &ctrl_chr,
    879876                                          curr_xattr_list_fname,
    880877                                          curr_acl_list_fname);
     
    886883        /*log_it(tmp); */
    887884        update_progress_form(tmp);
    888         res = verify_an_afioball_from_stream(bkpinfo, fname, size);
     885        res = verify_an_afioball_from_stream(fname, size);
    889886        if (res) {
    890887            sprintf(tmp, "Afioball %ld differs from live filesystem",
     
    917914 * @return 0 for success (even if there are differences); nonzero for a tape error.
    918915 */
    919 int verify_biggiefiles_from_stream(struct s_bkpinfo *bkpinfo)
     916int verify_biggiefiles_from_stream()
    920917{
    921918
     
    966963            iamhere("Grabbing the EXAT biggiefiles");
    967964            res =
    968                 read_EXAT_files_from_tape(bkpinfo, &size, orig_fname,
     965                read_EXAT_files_from_tape(&size, orig_fname,
    969966                                          &ctrl_chr, curr_xattr_list_fname,
    970967                                          curr_acl_list_fname);
     
    998995        sprintf(logical_fname, "%s/%s", bkpinfo->restore_path, orig_fname);
    999996        res =
    1000             verify_a_biggiefile_from_stream(bkpinfo, logical_fname, size);
     997            verify_a_biggiefile_from_stream(logical_fname, size);
    1001998        retval += res;
    1002999        current_biggiefile_number++;
     
    10301027 * @ingroup verifyGroup
    10311028 */
    1032 int verify_cd_image(struct s_bkpinfo *bkpinfo)
     1029int verify_cd_image()
    10331030{
    10341031
     
    10711068            popup_and_OK("Please push CD tray closed.");
    10721069        }
    1073         if (find_and_mount_actual_cd(bkpinfo, mountpoint)) {
     1070        if (find_and_mount_actual_cd(mountpoint)) {
    10741071            log_to_screen("failed to mount actual CD");
    10751072            return (1);
     
    11121109*/
    11131110    }
    1114     verify_afioballs_on_CD(bkpinfo, mountpoint);
     1111    verify_afioballs_on_CD(mountpoint);
    11151112    iamhere("before verify_all_slices");
    1116     verify_all_slices_on_CD(bkpinfo, mountpoint);
     1113    verify_all_slices_on_CD(mountpoint);
    11171114
    11181115#ifdef __FreeBSD__
     
    11551152 * @ingroup verifyGroup
    11561153 */
    1157 int verify_tape_backups(struct s_bkpinfo *bkpinfo)
     1154int verify_tape_backups()
    11581155{
    11591156
     
    11721169    log_msg(3, "verify_tape_backups --- starting");
    11731170    log_to_screen("Verifying backups");
    1174     openin_tape(bkpinfo);
     1171    openin_tape();
    11751172/* verify archives themselves */
    1176     retval += verify_afioballs_from_stream(bkpinfo);
    1177     retval += verify_biggiefiles_from_stream(bkpinfo);
     1173    retval += verify_afioballs_from_stream();
     1174    retval += verify_biggiefiles_from_stream();
    11781175/* find the final blocks */
    11791176    paranoid_system("sync");
    11801177    sleep(2);
    1181     closein_tape(bkpinfo);
     1178    closein_tape();
    11821179/* close tape; exit */
    11831180//  fclose(g_tape_stream); <-- not needed; is handled by closein_tape()
     
    12311228 * @ingroup stringGroup
    12321229 */
    1233 char *vfy_tball_fname(struct s_bkpinfo *bkpinfo, char *mountpoint,
    1234                       int setno)
     1230char *vfy_tball_fname(char *mountpoint, int setno)
    12351231{
    12361232    /*@ buffers ******************************************************* */
Note: See TracChangeset for help on using the changeset viewer.