@@ -1023,8 +1023,8 @@ EndPrepare(GlobalTransaction gxact)
10231023TwoPhaseFileHeader * hdr ;
10241024char path [MAXPGPATH ];
10251025StateFileChunk * record ;
1026- pg_crc32 statefile_crc ;
1027- pg_crc32 bogus_crc ;
1026+ pg_crc32c statefile_crc ;
1027+ pg_crc32c bogus_crc ;
10281028int fd ;
10291029
10301030/* Add the end sentinel to the list of 2PC records */
@@ -1034,7 +1034,7 @@ EndPrepare(GlobalTransaction gxact)
10341034/* Go back and fill in total_len in the file header record */
10351035hdr = (TwoPhaseFileHeader * )records .head -> data ;
10361036Assert (hdr -> magic == TWOPHASE_MAGIC );
1037- hdr -> total_len = records .total_len + sizeof (pg_crc32 );
1037+ hdr -> total_len = records .total_len + sizeof (pg_crc32c );
10381038
10391039/*
10401040 * If the file size exceeds MaxAllocSize, we won't be able to read it in
@@ -1082,7 +1082,7 @@ EndPrepare(GlobalTransaction gxact)
10821082 */
10831083bogus_crc = ~statefile_crc ;
10841084
1085- if ((write (fd ,& bogus_crc ,sizeof (pg_crc32 )))!= sizeof (pg_crc32 ))
1085+ if ((write (fd ,& bogus_crc ,sizeof (pg_crc32c )))!= sizeof (pg_crc32c ))
10861086{
10871087CloseTransientFile (fd );
10881088ereport (ERROR ,
@@ -1091,7 +1091,7 @@ EndPrepare(GlobalTransaction gxact)
10911091}
10921092
10931093/* Back up to prepare for rewriting the CRC */
1094- if (lseek (fd ,- ((off_t )sizeof (pg_crc32 )),SEEK_CUR )< 0 )
1094+ if (lseek (fd ,- ((off_t )sizeof (pg_crc32c )),SEEK_CUR )< 0 )
10951095{
10961096CloseTransientFile (fd );
10971097ereport (ERROR ,
@@ -1135,7 +1135,7 @@ EndPrepare(GlobalTransaction gxact)
11351135/* If we crash now, we have prepared: WAL replay will fix things */
11361136
11371137/* write correct CRC and close file */
1138- if ((write (fd ,& statefile_crc ,sizeof (pg_crc32 )))!= sizeof (pg_crc32 ))
1138+ if ((write (fd ,& statefile_crc ,sizeof (pg_crc32c )))!= sizeof (pg_crc32c ))
11391139{
11401140CloseTransientFile (fd );
11411141ereport (ERROR ,
@@ -1223,7 +1223,7 @@ ReadTwoPhaseFile(TransactionId xid, bool give_warnings)
12231223int fd ;
12241224struct stat stat ;
12251225uint32 crc_offset ;
1226- pg_crc32 calc_crc ,
1226+ pg_crc32c calc_crc ,
12271227file_crc ;
12281228
12291229TwoPhaseFilePath (path ,xid );
@@ -1258,14 +1258,14 @@ ReadTwoPhaseFile(TransactionId xid, bool give_warnings)
12581258
12591259if (stat .st_size < (MAXALIGN (sizeof (TwoPhaseFileHeader ))+
12601260MAXALIGN (sizeof (TwoPhaseRecordOnDisk ))+
1261- sizeof (pg_crc32 ))||
1261+ sizeof (pg_crc32c ))||
12621262stat .st_size > MaxAllocSize )
12631263{
12641264CloseTransientFile (fd );
12651265return NULL ;
12661266}
12671267
1268- crc_offset = stat .st_size - sizeof (pg_crc32 );
1268+ crc_offset = stat .st_size - sizeof (pg_crc32c );
12691269if (crc_offset != MAXALIGN (crc_offset ))
12701270{
12711271CloseTransientFile (fd );
@@ -1302,7 +1302,7 @@ ReadTwoPhaseFile(TransactionId xid, bool give_warnings)
13021302COMP_CRC32C (calc_crc ,buf ,crc_offset );
13031303FIN_CRC32C (calc_crc );
13041304
1305- file_crc = * ((pg_crc32 * ) (buf + crc_offset ));
1305+ file_crc = * ((pg_crc32c * ) (buf + crc_offset ));
13061306
13071307if (!EQ_CRC32C (calc_crc ,file_crc ))
13081308{
@@ -1545,7 +1545,7 @@ void
15451545RecreateTwoPhaseFile (TransactionId xid ,void * content ,int len )
15461546{
15471547char path [MAXPGPATH ];
1548- pg_crc32 statefile_crc ;
1548+ pg_crc32c statefile_crc ;
15491549int fd ;
15501550
15511551/* Recompute CRC */
@@ -1572,7 +1572,7 @@ RecreateTwoPhaseFile(TransactionId xid, void *content, int len)
15721572(errcode_for_file_access (),
15731573errmsg ("could not write two-phase state file: %m" )));
15741574}
1575- if (write (fd ,& statefile_crc ,sizeof (pg_crc32 ))!= sizeof (pg_crc32 ))
1575+ if (write (fd ,& statefile_crc ,sizeof (pg_crc32c ))!= sizeof (pg_crc32c ))
15761576{
15771577CloseTransientFile (fd );
15781578ereport (ERROR ,