@@ -487,7 +487,7 @@ compress_and_backup_page(pgFile *file, BlockNumber blknum,
487
487
blknum, header.compressed_size, write_buffer_size); */
488
488
489
489
/* Update CRC */
490
- COMP_TRADITIONAL_CRC32 ( * crc , write_buffer , write_buffer_size );
490
+ COMP_FILE_CRC32 (false, * crc , write_buffer , write_buffer_size );
491
491
492
492
/* write data page */
493
493
if (fwrite (write_buffer , 1 , write_buffer_size , out ) != write_buffer_size )
@@ -547,13 +547,13 @@ backup_data_file(backup_files_arg* arguments,
547
547
/* reset size summary */
548
548
file -> read_size = 0 ;
549
549
file -> write_size = 0 ;
550
- INIT_TRADITIONAL_CRC32 ( file -> crc );
550
+ INIT_FILE_CRC32 (false, file -> crc );
551
551
552
552
/* open backup mode file for read */
553
553
in = fopen (file -> path , PG_BINARY_R );
554
554
if (in == NULL )
555
555
{
556
- FIN_TRADITIONAL_CRC32 ( file -> crc );
556
+ FIN_FILE_CRC32 (false, file -> crc );
557
557
558
558
/*
559
559
* If file is not found, this is not en error.
@@ -658,7 +658,7 @@ backup_data_file(backup_files_arg* arguments,
658
658
to_path , strerror (errno ));
659
659
fclose (in );
660
660
661
- FIN_TRADITIONAL_CRC32 ( file -> crc );
661
+ FIN_FILE_CRC32 (false, file -> crc );
662
662
663
663
/*
664
664
* If we have pagemap then file in the backup can't be a zero size.
@@ -927,7 +927,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file)
927
927
struct stat st ;
928
928
pg_crc32 crc ;
929
929
930
- INIT_TRADITIONAL_CRC32 ( crc );
930
+ INIT_FILE_CRC32 (false, crc );
931
931
932
932
/* reset size summary */
933
933
file -> read_size = 0 ;
@@ -937,7 +937,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file)
937
937
in = fopen (file -> path , PG_BINARY_R );
938
938
if (in == NULL )
939
939
{
940
- FIN_TRADITIONAL_CRC32 ( crc );
940
+ FIN_FILE_CRC32 (false, crc );
941
941
file -> crc = crc ;
942
942
943
943
/* maybe deleted, it's not error */
@@ -986,7 +986,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file)
986
986
strerror (errno_tmp ));
987
987
}
988
988
/* update CRC */
989
- COMP_TRADITIONAL_CRC32 ( crc , buf , read_len );
989
+ COMP_FILE_CRC32 (false, crc , buf , read_len );
990
990
991
991
file -> read_size += read_len ;
992
992
}
@@ -1013,14 +1013,14 @@ copy_file(const char *from_root, const char *to_root, pgFile *file)
1013
1013
strerror (errno_tmp ));
1014
1014
}
1015
1015
/* update CRC */
1016
- COMP_TRADITIONAL_CRC32 ( crc , buf , read_len );
1016
+ COMP_FILE_CRC32 (false, crc , buf , read_len );
1017
1017
1018
1018
file -> read_size += read_len ;
1019
1019
}
1020
1020
1021
1021
file -> write_size = (int64 ) file -> read_size ;
1022
1022
/* finish CRC calculation and store into pgFile */
1023
- FIN_TRADITIONAL_CRC32 ( crc );
1023
+ FIN_FILE_CRC32 (false, crc );
1024
1024
file -> crc = crc ;
1025
1025
1026
1026
/* update file permission */
0 commit comments