Changeset 3340 in MondoRescue
- Timestamp:
- Feb 12, 2015, 7:38:20 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/common/libmondo-archive.c
r3294 r3340 826 826 } 827 827 828 estimated_total_noof_slices = size_of_all_biggiefiles_K( bkpinfo) / bkpinfo->optimal_set_size + 1;828 estimated_total_noof_slices = size_of_all_biggiefiles_K() / bkpinfo->optimal_set_size + 1L; 829 829 830 830 /* TODO: add netfs stuff here? */ … … 1924 1924 * @see slice_up_file_etc 1925 1925 */ 1926 int 1927 make_slices_and_images(char *biggielist_fname) 1928 { 1926 int make_slices_and_images(char *biggielist_fname) { 1929 1927 1930 1928 /*@ pointers ******************************************* */ … … 1942 1940 long noof_biggie_files = 0L; 1943 1941 long estimated_total_noof_slices = 0L; 1942 long size_of_all_biggiefiles = 0L; 1944 1943 1945 1944 /*@ int ************************************************ */ … … 1955 1954 assert_string_is_neither_NULL_nor_zerolength(biggielist_fname); 1956 1955 1957 estimated_total_noof_slices = size_of_all_biggiefiles_K() / bkpinfo->optimal_set_size + 1L; 1958 1959 log_msg(1, "size of all biggiefiles = %ld", size_of_all_biggiefiles_K()); 1960 log_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld", size_of_all_biggiefiles_K(), bkpinfo->optimal_set_size, estimated_total_noof_slices); 1956 size_of_all_biggiefiles = size_of_all_biggiefiles_K(); 1957 estimated_total_noof_slices = size_of_all_biggiefiles / bkpinfo->optimal_set_size + 1L; 1958 1959 log_msg(1, "size of all biggiefiles = %ld", size_of_all_biggiefiles); 1960 log_msg(1, "estimated_total_noof_slices = %ld KB / %ld KB = %ld", size_of_all_biggiefiles, bkpinfo->optimal_set_size, estimated_total_noof_slices); 1961 1961 1962 1962 if (length_of_file(biggielist_fname) < 6) { … … 2038 2038 2039 2039 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2040 write_header_block_to_stream((off_t)0, 2041 calc_checksum_of_file 2042 (bigfile_fname), 2043 BLK_STOP_A_BIGGIE); 2040 write_header_block_to_stream((off_t)0, calc_checksum_of_file(bigfile_fname), BLK_STOP_A_BIGGIE); 2044 2041 } 2045 2042 retval += res; … … 2272 2269 assert(bkpinfo != NULL); 2273 2270 /* slice big files */ 2274 mvaddstr_and_log_it(g_currentY, 0, 2275 "Archiving large files to media "); 2271 mvaddstr_and_log_it(g_currentY, 0, "Archiving large files to media "); 2276 2272 mr_asprintf(biggielist, "%s/archives/biggielist.txt", bkpinfo->scratchdir); 2277 2273 if (g_getfattr) { … … 2315 2311 res = make_slices_and_images(biggielist); 2316 2312 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2317 write_header_block_to_stream((off_t)0, "end-of-biggiefiles", 2318 BLK_STOP_BIGGIEFILES); 2313 write_header_block_to_stream((off_t)0, "end-of-biggiefiles", BLK_STOP_BIGGIEFILES); 2319 2314 } 2320 2315 retval += res; … … 2387 2382 mr_asprintf(curr_file, "%s", cf); 2388 2383 if (!does_file_exist(curr_file)) { 2389 log_msg(1, 2390 "Warning - you're trying to add a non-existent file - '%s' to the CD", 2391 curr_file); 2384 log_msg(1, "Warning - you're trying to add a non-existent file - '%s' to the CD", curr_file); 2392 2385 } else { 2393 2386 log_msg(8, "Trying to add file %s to CD", curr_file); … … 2764 2757 * @ingroup LLarchiveGroup 2765 2758 */ 2766 int 2767 slice_up_file_etc(char *biggie_filename, char *ntfsprog_fifo, long biggie_file_number, long noof_biggie_files, bool use_ntfsprog) { 2759 int slice_up_file_etc(char *biggie_filename, char *ntfsprog_fifo, long biggie_file_number, long noof_biggie_files, bool use_ntfsprog) { 2768 2760 2769 2761 /*@ buffers ************************************************** */ … … 2848 2840 mr_getline(checksum_line, fin); 2849 2841 pclose(fin); 2850 totallength = length_of_file 2842 totallength = length_of_file(biggie_filename); 2851 2843 } 2852 2844 lstat(biggie_filename, &biggiestruct.properties); … … 2885 2877 } 2886 2878 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 2887 res = 2888 move_files_to_stream(slice_fname(biggie_file_number, 0, 2889 bkpinfo->tmpdir, ""), NULL); 2890 } else { 2891 res = 2892 move_files_to_cd(slice_fname(biggie_file_number, 0, 2893 bkpinfo->tmpdir, ""), NULL); 2894 } 2895 i = bkpinfo->optimal_set_size / 256; 2879 res = move_files_to_stream(slice_fname(biggie_file_number, 0, bkpinfo->tmpdir, ""), NULL); 2880 } else { 2881 res = move_files_to_cd(slice_fname(biggie_file_number, 0, bkpinfo->tmpdir, ""), NULL); 2882 } 2883 i = bkpinfo->optimal_set_size / 256L; 2896 2884 if (!(tempblock = (char *) malloc(256 * 1024))) { 2897 2885 fatal_error("malloc error 256*1024"); … … 2910 2898 return (1); 2911 2899 } 2912 if ((i == bkpinfo->optimal_set_size / 256 ) && (totalread < 1.1 * totallength)) {2913 for ( i = 0L; i < bkpinfo->optimal_set_size / 256; i++) {2900 if ((i == bkpinfo->optimal_set_size / 256L) && (totalread < 1.1 * totallength)) { 2901 for (long j = 0L; j < bkpinfo->optimal_set_size / 256L; j++) { 2914 2902 blksize = fread(tempblock, 1, 256 * 1024, fin); 2915 2903 if (blksize > 0) {
Note:
See TracChangeset
for help on using the changeset viewer.