@ -77,11 +77,11 @@ typedef struct ReplicationSlotOnDisk
# define ReplicationSlotOnDiskConstantSize \
# define ReplicationSlotOnDiskConstantSize \
offsetof ( ReplicationSlotOnDisk , slotdata )
offsetof ( ReplicationSlotOnDisk , slotdata )
/* size of the part of the slot not covered by the checksum */
/* size of the part of the slot not covered by the checksum */
# define SnapBuildOnDiskNotChecksummedSize \
# define ReplicationSlotOnDiskNotChecksummedSize \
offsetof ( ReplicationSlotOnDisk , version )
offsetof ( ReplicationSlotOnDisk , version )
/* size of the part covered by the checksum */
/* size of the part covered by the checksum */
# define SnapBuild OnDiskChecksummedSize \
# define ReplicationSlot OnDiskChecksummedSize \
sizeof ( ReplicationSlotOnDisk ) - SnapBuild OnDiskNotChecksummedSize
sizeof ( ReplicationSlotOnDisk ) - ReplicationSlot OnDiskNotChecksummedSize
/* size of the slot data that is version dependent */
/* size of the slot data that is version dependent */
# define ReplicationSlotOnDiskV2Size \
# define ReplicationSlotOnDiskV2Size \
sizeof ( ReplicationSlotOnDisk ) - ReplicationSlotOnDiskConstantSize
sizeof ( ReplicationSlotOnDisk ) - ReplicationSlotOnDiskConstantSize
@ -1571,8 +1571,8 @@ SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel)
SpinLockRelease ( & slot - > mutex ) ;
SpinLockRelease ( & slot - > mutex ) ;
COMP_CRC32C ( cp . checksum ,
COMP_CRC32C ( cp . checksum ,
( char * ) ( & cp ) + SnapBuild OnDiskNotChecksummedSize,
( char * ) ( & cp ) + ReplicationSlot OnDiskNotChecksummedSize,
SnapBuild OnDiskChecksummedSize) ;
ReplicationSlot OnDiskChecksummedSize) ;
FIN_CRC32C ( cp . checksum ) ;
FIN_CRC32C ( cp . checksum ) ;
errno = 0 ;
errno = 0 ;
@ -1787,8 +1787,8 @@ RestoreSlotFromDisk(const char *name)
/* now verify the CRC */
/* now verify the CRC */
INIT_CRC32C ( checksum ) ;
INIT_CRC32C ( checksum ) ;
COMP_CRC32C ( checksum ,
COMP_CRC32C ( checksum ,
( char * ) & cp + SnapBuild OnDiskNotChecksummedSize,
( char * ) & cp + ReplicationSlot OnDiskNotChecksummedSize,
SnapBuild OnDiskChecksummedSize) ;
ReplicationSlot OnDiskChecksummedSize) ;
FIN_CRC32C ( checksum ) ;
FIN_CRC32C ( checksum ) ;
if ( ! EQ_CRC32C ( checksum , cp . checksum ) )
if ( ! EQ_CRC32C ( checksum , cp . checksum ) )