Changeset 1663 in MondoRescue for branches/stable/mondo/src/common/libmondo-stream.c
- Timestamp:
- Sep 27, 2007, 12:21:18 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/common/libmondo-stream.c
r1639 r1663 42 42 extern struct mr_ar_conf *mr_conf; 43 43 44 /* Reference to global bkpinfo */ 45 extern struct s_bkpinfo *bkpinfo; 46 44 47 /** 45 48 * @addtogroup globalGroup … … 127 130 * @note This should be called by restore processes only. 128 131 */ 129 int closein_cdstream( struct s_bkpinfo *bkpinfo)130 { 131 return (closein_tape( bkpinfo));132 int closein_cdstream() 133 { 134 return (closein_tape()); 132 135 } 133 136 … … 142 145 * @bug @p bkpinfo parameter is unused. 143 146 */ 144 int closein_tape( struct s_bkpinfo *bkpinfo)147 int closein_tape() 145 148 { 146 149 /*@ int's ******************************************************* */ … … 195 198 * @note This should be called by backup processes only. 196 199 */ 197 int closeout_tape( struct s_bkpinfo *bkpinfo)200 int closeout_tape() 198 201 { 199 202 /*@ int's ******************************************************* */ … … 224 227 if (should_we_write_to_next_tape 225 228 (bkpinfo->media_size, (off_t)256 * 1024)) { 226 start_to_write_to_next_tape( bkpinfo);229 start_to_write_to_next_tape(); 227 230 } 228 231 } … … 354 357 355 358 356 int read_EXAT_files_from_tape(struct s_bkpinfo *bkpinfo, 357 long long *ptmp_size, char *tmp_fname, 359 int read_EXAT_files_from_tape(long long *ptmp_size, char *tmp_fname, 358 360 int *pctrl_chr, char *xattr_fname, 359 361 char *acl_fname) … … 372 374 fatal_error("Wrong order, sunshine."); 373 375 } 374 read_file_from_stream_to_file( bkpinfo,xattr_fname, *ptmp_size);376 read_file_from_stream_to_file(xattr_fname, *ptmp_size); 375 377 res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr); 376 378 if (*pctrl_chr != BLK_STOP_EXAT_FILE) { … … 388 390 wrong_marker(BLK_START_EXAT_FILE, *pctrl_chr); 389 391 } 390 read_file_from_stream_to_file( bkpinfo,acl_fname, *ptmp_size);392 read_file_from_stream_to_file(acl_fname, *ptmp_size); 391 393 res = read_header_block_from_stream(ptmp_size, tmp_fname, pctrl_chr); 392 394 if (*pctrl_chr != BLK_STOP_EXAT_FILE) { … … 406 408 407 409 408 int write_EXAT_files_to_tape( struct s_bkpinfo *bkpinfo,char *xattr_fname,410 int write_EXAT_files_to_tape(char *xattr_fname, 409 411 char *acl_fname) 410 412 { … … 416 418 write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname, 417 419 BLK_START_EXAT_FILE); 418 write_file_to_stream_from_file( bkpinfo,xattr_fname);420 write_file_to_stream_from_file(xattr_fname); 419 421 write_header_block_to_stream((off_t)-1, xattr_fname, BLK_STOP_EXAT_FILE); 420 422 } … … 423 425 write_header_block_to_stream(length_of_file(acl_fname), acl_fname, 424 426 BLK_START_EXAT_FILE); 425 write_file_to_stream_from_file( bkpinfo,acl_fname);427 write_file_to_stream_from_file(acl_fname); 426 428 write_header_block_to_stream((off_t)-1, acl_fname, BLK_STOP_EXAT_FILE); 427 429 write_header_block_to_stream(length_of_file(xattr_fname), xattr_fname, … … 570 572 * @note Equivalent to openin_tape() for now, but don't count on this behavior. 571 573 */ 572 int openin_cdstream( struct s_bkpinfo *bkpinfo)573 { 574 return (openin_tape( bkpinfo));574 int openin_cdstream() 575 { 576 return (openin_tape()); 575 577 } 576 578 … … 603 605 * @note This will also work with a cdstream for now, but don't count on this behavior. 604 606 */ 605 int openin_tape( struct s_bkpinfo *bkpinfo)607 int openin_tape() 606 608 { 607 609 /*@ buffer ***************************************************** */ … … 778 780 */ 779 781 int 780 read_file_from_stream_to_file(struct s_bkpinfo *bkpinfo, char *outfile, 781 long long size) 782 read_file_from_stream_to_file(char *outfile, long long size) 782 783 { 783 784 … … 787 788 /*@ end vars *************************************************** */ 788 789 789 res = read_file_from_stream_FULL( bkpinfo,outfile, NULL, size);790 res = read_file_from_stream_FULL(outfile, NULL, size); 790 791 791 792 return (res); … … 802 803 */ 803 804 int 804 read_file_from_stream_to_stream(struct s_bkpinfo *bkpinfo, FILE * fout, 805 long long size) 805 read_file_from_stream_to_stream(FILE * fout, long long size) 806 806 { 807 807 … … 811 811 /*@ end vars *************************************************** */ 812 812 813 res = read_file_from_stream_FULL( bkpinfo,NULL, fout, size);813 res = read_file_from_stream_FULL(NULL, fout, size); 814 814 return (res); 815 815 } … … 829 829 */ 830 830 int 831 read_file_from_stream_FULL(struct s_bkpinfo *bkpinfo, char *outfname, 832 FILE * foutstream, long long orig_size) 831 read_file_from_stream_FULL(char *outfname, FILE * foutstream, long long orig_size) 833 832 { 834 833 /*@ buffers ***************************************************** */ … … 915 914 mr_msg(4, "where_I_was_... = %lld", 916 915 where_I_was_before_tape_change); 917 start_to_read_from_next_tape( bkpinfo);916 start_to_read_from_next_tape(); 918 917 mr_msg(4, "Started reading from next tape."); 919 918 skip_incoming_files_until_we_find_this_one(temp_fname); … … 1238 1237 * @return 0 for success, nonzero for failure. 1239 1238 */ 1240 int start_to_read_from_next_tape( struct s_bkpinfo *bkpinfo)1239 int start_to_read_from_next_tape() 1241 1240 { 1242 1241 /*@ int ********************************************************* */ … … 1284 1283 * @return 0 for success, nonzero for failure. 1285 1284 */ 1286 int start_to_write_to_next_tape( struct s_bkpinfo *bkpinfo)1285 int start_to_write_to_next_tape() 1287 1286 { 1288 1287 int res = 0; … … 1339 1338 * @return 0 for success, nonzero for failure. 1340 1339 */ 1341 int write_backcatalog_to_tape( struct s_bkpinfo *bkpinfo)1340 int write_backcatalog_to_tape() 1342 1341 { 1343 1342 int res = 0; … … 1358 1357 BLK_START_AN_AFIO_OR_SLICE); 1359 1358 mr_msg(2, "Writing %s", fname); 1360 if (write_file_to_stream_from_file( bkpinfo,fname)) {1359 if (write_file_to_stream_from_file(fname)) { 1361 1360 res++; 1362 1361 mr_msg(2, "%s failed", fname); … … 1443 1442 * @return 0 for success, nonzero for failure. 1444 1443 */ 1445 int write_file_to_stream_from_file( struct s_bkpinfo *bkpinfo,char *infile)1444 int write_file_to_stream_from_file(char *infile) 1446 1445 { 1447 1446 /*@ buffers **************************************************** */ … … 1489 1488 if (should_we_write_to_next_tape 1490 1489 (bkpinfo->media_size, filesize)) { 1491 start_to_write_to_next_tape( bkpinfo);1492 write_backcatalog_to_tape( bkpinfo);1490 start_to_write_to_next_tape(); 1491 write_backcatalog_to_tape(); 1493 1492 } 1494 1493 p = strrchr(infile, '/'); … … 1528 1527 fclose(fin); 1529 1528 g_sigpipe = FALSE; 1530 start_to_write_to_next_tape( bkpinfo);1531 write_backcatalog_to_tape( bkpinfo); // kinda-sorta recursive :)1529 start_to_write_to_next_tape(); 1530 write_backcatalog_to_tape(); // kinda-sorta recursive :) 1532 1531 return (0); 1533 1532 }
Note:
See TracChangeset
for help on using the changeset viewer.