Changeset 1645 in MondoRescue for branches/2.2.5/mondo/src/common/libmondo-stream.c
- Timestamp:
- Sep 24, 2007, 3:04:43 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.5/mondo/src/common/libmondo-stream.c
r1316 r1645 120 120 extern char *MONDO_LOGFILE; 121 121 122 /* Reference to global bkpinfo */ 123 extern struct s_bkpinfo *bkpinfo; 124 122 125 /** 123 126 * @addtogroup globalGroup … … 150 153 /* @} - end of globalGroup */ 151 154 152 int write_backcatalog_to_tape( struct s_bkpinfo *bkpinfo);155 int write_backcatalog_to_tape(); 153 156 154 157 … … 167 170 * @note This should be called by restore processes only. 168 171 */ 169 int closein_cdstream( struct s_bkpinfo *bkpinfo)170 { 171 return (closein_tape( bkpinfo));172 int closein_cdstream() 173 { 174 return (closein_tape()); 172 175 } 173 176 … … 182 185 * @bug @p bkpinfo parameter is unused. 183 186 */ 184 int closein_tape( struct s_bkpinfo *bkpinfo)187 int closein_tape() 185 188 { 186 189 /*@ int's ******************************************************* */ … … 241 244 * @note This should be called by backup processes only. 242 245 */ 243 int closeout_tape( struct s_bkpinfo *bkpinfo)246 int closeout_tape() 244 247 { 245 248 /*@ int's ******************************************************* */ … … 274 277 if (should_we_write_to_next_tape 275 278 (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(); 277 280 } 278 281 } … … 288 291 if (should_we_write_to_next_tape (bkpinfo->media_size[g_current_media_number], 256*1024)) 289 292 { 290 start_to_write_to_next_tape ( bkpinfo);293 start_to_write_to_next_tape (); 291 294 } 292 295 } … … 438 441 439 442 440 int read_EXAT_files_from_tape(struct s_bkpinfo *bkpinfo, 441 long long *ptmp_size, char *tmp_fname, 443 int read_EXAT_files_from_tape(long long *ptmp_size, char *tmp_fname, 442 444 int *pctrl_chr, char *xattr_fname, 443 445 char *acl_fname) … … 456 458 fatal_error("Wrong order, sunshine."); 457 459 } 458 read_file_from_stream_to_file( bkpinfo,xattr_fname, *ptmp_size);460 read_file_from_stream_to_file(xattr_fname, *ptmp_size); 459 461 res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr); 460 462 if (*pctrl_chr != BLK_STOP_EXAT_FILE) { … … 472 474 wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr); 473 475 } 474 read_file_from_stream_to_file( bkpinfo,acl_fname, *ptmp_size);476 read_file_from_stream_to_file(acl_fname, *ptmp_size); 475 477 res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr); 476 478 if (*pctrl_chr != BLK_STOP_EXAT_FILE) { … … 490 492 491 493 492 int write_EXAT_files_to_tape( struct s_bkpinfo *bkpinfo,char *xattr_fname,494 int write_EXAT_files_to_tape(char *xattr_fname, 493 495 char *acl_fname) 494 496 { … … 500 502 write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname, 501 503 BLK_START_EXAT_FILE); 502 write_file_to_stream_from_file( bkpinfo,xattr_fname);504 write_file_to_stream_from_file(xattr_fname); 503 505 write_header_block_to_stream((off_t)-1, xattr_fname, BLK_STOP_EXAT_FILE); 504 506 } … … 507 509 write_header_block_to_stream(length_of_file(acl_fname), acl_fname, 508 510 BLK_START_EXAT_FILE); 509 write_file_to_stream_from_file( bkpinfo,acl_fname);511 write_file_to_stream_from_file(acl_fname); 510 512 write_header_block_to_stream((off_t)-1, acl_fname, BLK_STOP_EXAT_FILE); 511 513 write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname, … … 655 657 * @note Equivalent to openin_tape() for now, but don't count on this behavior. 656 658 */ 657 int openin_cdstream( struct s_bkpinfo *bkpinfo)658 { 659 return (openin_tape( bkpinfo));659 int openin_cdstream() 660 { 661 return (openin_tape()); 660 662 } 661 663 … … 696 698 * @note This will also work with a cdstream for now, but don't count on this behavior. 697 699 */ 698 int openin_tape( struct s_bkpinfo *bkpinfo)700 int openin_tape() 699 701 { 700 702 /*@ buffer ***************************************************** */ … … 886 888 */ 887 889 int 888 read_file_from_stream_to_file(struct s_bkpinfo *bkpinfo, char *outfile, 889 long long size) 890 read_file_from_stream_to_file(char *outfile, long long size) 890 891 { 891 892 … … 895 896 /*@ end vars *************************************************** */ 896 897 897 res = read_file_from_stream_FULL( bkpinfo,outfile, NULL, size);898 res = read_file_from_stream_FULL(outfile, NULL, size); 898 899 899 900 return (res); … … 911 912 */ 912 913 int 913 read_file_from_stream_to_stream(struct s_bkpinfo *bkpinfo, FILE * fout, 914 long long size) 914 read_file_from_stream_to_stream(FILE * fout, long long size) 915 915 { 916 916 … … 920 920 /*@ end vars *************************************************** */ 921 921 922 res = read_file_from_stream_FULL( bkpinfo,NULL, fout, size);922 res = read_file_from_stream_FULL(NULL, fout, size); 923 923 /* fflush(g_tape_stream); 924 924 fflush(fout);*/ … … 941 941 */ 942 942 int 943 read_file_from_stream_FULL(struct s_bkpinfo *bkpinfo, char *outfname, 944 FILE * foutstream, long long orig_size) 943 read_file_from_stream_FULL(char *outfname, FILE * foutstream, long long orig_size) 945 944 { 946 945 /*@ buffers ***************************************************** */ … … 1029 1028 log_msg(4, "where_I_was_... = %lld", 1030 1029 where_I_was_before_tape_change); 1031 start_to_read_from_next_tape( bkpinfo);1030 start_to_read_from_next_tape(); 1032 1031 log_msg(4, "Started reading from next tape."); 1033 1032 skip_incoming_files_until_we_find_this_one(temp_fname); … … 1362 1361 * @return 0 for success, nonzero for failure. 1363 1362 */ 1364 int start_to_read_from_next_tape( struct s_bkpinfo *bkpinfo)1363 int start_to_read_from_next_tape() 1365 1364 { 1366 1365 /*@ int ********************************************************* */ … … 1410 1409 * @return 0 for success, nonzero for failure. 1411 1410 */ 1412 int start_to_write_to_next_tape( struct s_bkpinfo *bkpinfo)1411 int start_to_write_to_next_tape() 1413 1412 { 1414 1413 int res = 0; … … 1470 1469 * @return 0 for success, nonzero for failure. 1471 1470 */ 1472 int write_backcatalog_to_tape( struct s_bkpinfo *bkpinfo)1471 int write_backcatalog_to_tape() 1473 1472 { 1474 1473 int i, last, res = 0; … … 1488 1487 BLK_START_AN_AFIO_OR_SLICE); 1489 1488 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)) { 1491 1490 res++; 1492 1491 log_msg(2, "%s failed", fname); … … 1574 1573 * @return 0 for success, nonzero for failure. 1575 1574 */ 1576 int write_file_to_stream_from_file( struct s_bkpinfo *bkpinfo,char *infile)1575 int write_file_to_stream_from_file(char *infile) 1577 1576 { 1578 1577 /*@ buffers **************************************************** */ … … 1621 1620 if (should_we_write_to_next_tape 1622 1621 (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(); 1625 1624 } 1626 1625 p = strrchr(infile, '/'); … … 1659 1658 fclose(fin); 1660 1659 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 :) 1663 1662 return (0); 1664 1663 }
Note:
See TracChangeset
for help on using the changeset viewer.