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-stream.c

    r1316 r1645  
    120120extern char *MONDO_LOGFILE;
    121121
     122/* Reference to global bkpinfo */
     123extern struct s_bkpinfo *bkpinfo;
     124
    122125/**
    123126 * @addtogroup globalGroup
     
    150153/* @} - end of globalGroup */
    151154
    152 int write_backcatalog_to_tape(struct s_bkpinfo *bkpinfo);
     155int write_backcatalog_to_tape();
    153156
    154157
     
    167170 * @note This should be called by restore processes only.
    168171 */
    169 int closein_cdstream(struct s_bkpinfo *bkpinfo)
    170 {
    171     return (closein_tape(bkpinfo));
     172int closein_cdstream()
     173{
     174    return (closein_tape());
    172175}
    173176
     
    182185 * @bug @p bkpinfo parameter is unused.
    183186 */
    184 int closein_tape(struct s_bkpinfo *bkpinfo)
     187int closein_tape()
    185188{
    186189    /*@ int's ******************************************************* */
     
    241244 * @note This should be called by backup processes only.
    242245 */
    243 int closeout_tape(struct s_bkpinfo *bkpinfo)
     246int closeout_tape()
    244247{
    245248    /*@ int's ******************************************************* */
     
    274277        if (should_we_write_to_next_tape
    275278            (bkpinfo->media_size[g_current_media_number], (off_t)256 * 1024)) {
    276             start_to_write_to_next_tape(bkpinfo);
     279            start_to_write_to_next_tape();
    277280        }
    278281    }
     
    288291        if (should_we_write_to_next_tape (bkpinfo->media_size[g_current_media_number], 256*1024))
    289292          {
    290             start_to_write_to_next_tape (bkpinfo);
     293            start_to_write_to_next_tape ();
    291294          }
    292295      }
     
    438441
    439442
    440 int read_EXAT_files_from_tape(struct s_bkpinfo *bkpinfo,
    441                               long long *ptmp_size, char *tmp_fname,
     443int read_EXAT_files_from_tape(long long *ptmp_size, char *tmp_fname,
    442444                              int *pctrl_chr, char *xattr_fname,
    443445                              char *acl_fname)
     
    456458            fatal_error("Wrong order, sunshine.");
    457459        }
    458         read_file_from_stream_to_file(bkpinfo, xattr_fname, *ptmp_size);
     460        read_file_from_stream_to_file(xattr_fname, *ptmp_size);
    459461        res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
    460462        if (*pctrl_chr != BLK_STOP_EXAT_FILE) {
     
    472474            wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr);
    473475        }
    474         read_file_from_stream_to_file(bkpinfo, acl_fname, *ptmp_size);
     476        read_file_from_stream_to_file(acl_fname, *ptmp_size);
    475477        res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr);
    476478        if (*pctrl_chr != BLK_STOP_EXAT_FILE) {
     
    490492
    491493
    492 int write_EXAT_files_to_tape(struct s_bkpinfo *bkpinfo, char *xattr_fname,
     494int write_EXAT_files_to_tape(char *xattr_fname,
    493495                             char *acl_fname)
    494496{
     
    500502        write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
    501503                             BLK_START_EXAT_FILE);
    502         write_file_to_stream_from_file(bkpinfo, xattr_fname);
     504        write_file_to_stream_from_file(xattr_fname);
    503505        write_header_block_to_stream((off_t)-1, xattr_fname, BLK_STOP_EXAT_FILE);
    504506    }
     
    507509        write_header_block_to_stream(length_of_file(acl_fname), acl_fname,
    508510                             BLK_START_EXAT_FILE);
    509         write_file_to_stream_from_file(bkpinfo, acl_fname);
     511        write_file_to_stream_from_file(acl_fname);
    510512        write_header_block_to_stream((off_t)-1, acl_fname, BLK_STOP_EXAT_FILE);
    511513        write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname,
     
    655657 * @note Equivalent to openin_tape() for now, but don't count on this behavior.
    656658 */
    657 int openin_cdstream(struct s_bkpinfo *bkpinfo)
    658 {
    659     return (openin_tape(bkpinfo));
     659int openin_cdstream()
     660{
     661    return (openin_tape());
    660662}
    661663
     
    696698 * @note This will also work with a cdstream for now, but don't count on this behavior.
    697699 */
    698 int openin_tape(struct s_bkpinfo *bkpinfo)
     700int openin_tape()
    699701{
    700702    /*@ buffer ***************************************************** */
     
    886888 */
    887889int
    888 read_file_from_stream_to_file(struct s_bkpinfo *bkpinfo, char *outfile,
    889                               long long size)
     890read_file_from_stream_to_file(char *outfile, long long size)
    890891{
    891892
     
    895896    /*@ end vars *************************************************** */
    896897
    897     res = read_file_from_stream_FULL(bkpinfo, outfile, NULL, size);
     898    res = read_file_from_stream_FULL(outfile, NULL, size);
    898899
    899900    return (res);
     
    911912 */
    912913int
    913 read_file_from_stream_to_stream(struct s_bkpinfo *bkpinfo, FILE * fout,
    914                                 long long size)
     914read_file_from_stream_to_stream(FILE * fout, long long size)
    915915{
    916916
     
    920920    /*@ end vars *************************************************** */
    921921
    922     res = read_file_from_stream_FULL(bkpinfo, NULL, fout, size);
     922    res = read_file_from_stream_FULL(NULL, fout, size);
    923923/*  fflush(g_tape_stream);
    924924  fflush(fout);*/
     
    941941 */
    942942int
    943 read_file_from_stream_FULL(struct s_bkpinfo *bkpinfo, char *outfname,
    944                            FILE * foutstream, long long orig_size)
     943read_file_from_stream_FULL(char *outfname, FILE * foutstream, long long orig_size)
    945944{
    946945    /*@ buffers ***************************************************** */
     
    10291028            log_msg(4, "where_I_was_... = %lld",
    10301029                    where_I_was_before_tape_change);
    1031             start_to_read_from_next_tape(bkpinfo);
     1030            start_to_read_from_next_tape();
    10321031            log_msg(4, "Started reading from next tape.");
    10331032            skip_incoming_files_until_we_find_this_one(temp_fname);
     
    13621361 * @return 0 for success, nonzero for failure.
    13631362 */
    1364 int start_to_read_from_next_tape(struct s_bkpinfo *bkpinfo)
     1363int start_to_read_from_next_tape()
    13651364{
    13661365    /*@ int ********************************************************* */
     
    14101409 * @return 0 for success, nonzero for failure.
    14111410 */
    1412 int start_to_write_to_next_tape(struct s_bkpinfo *bkpinfo)
     1411int start_to_write_to_next_tape()
    14131412{
    14141413    int res = 0;
     
    14701469 * @return 0 for success, nonzero for failure.
    14711470 */
    1472 int write_backcatalog_to_tape(struct s_bkpinfo *bkpinfo)
     1471int write_backcatalog_to_tape()
    14731472{
    14741473    int i, last, res = 0;
     
    14881487                                         BLK_START_AN_AFIO_OR_SLICE);
    14891488            log_msg(2, "Writing %s", fname);
    1490             if (write_file_to_stream_from_file(bkpinfo, fname)) {
     1489            if (write_file_to_stream_from_file(fname)) {
    14911490                res++;
    14921491                log_msg(2, "%s failed", fname);
     
    15741573 * @return 0 for success, nonzero for failure.
    15751574 */
    1576 int write_file_to_stream_from_file(struct s_bkpinfo *bkpinfo, char *infile)
     1575int write_file_to_stream_from_file(char *infile)
    15771576{
    15781577    /*@ buffers **************************************************** */
     
    16211620    if (should_we_write_to_next_tape
    16221621        (bkpinfo->media_size[g_current_media_number], filesize)) {
    1623         start_to_write_to_next_tape(bkpinfo);
    1624         write_backcatalog_to_tape(bkpinfo);
     1622        start_to_write_to_next_tape();
     1623        write_backcatalog_to_tape();
    16251624    }
    16261625    p = strrchr(infile, '/');
     
    16591658            fclose(fin);
    16601659            g_sigpipe = FALSE;
    1661             start_to_write_to_next_tape(bkpinfo);
    1662             write_backcatalog_to_tape(bkpinfo); // kinda-sorta recursive :)
     1660            start_to_write_to_next_tape();
     1661            write_backcatalog_to_tape();    // kinda-sorta recursive :)
    16631662            return (0);
    16641663        }
Note: See TracChangeset for help on using the changeset viewer.