File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -654,7 +654,7 @@ ptrack_mark_block(RelFileNodeBackend smgr_rnode,
654654 ForkNumber forknum , BlockNumber blocknum )
655655{
656656 PtBlockId bid ;
657- size_t hash ;
657+ uint64 hash ;
658658 size_t slot1 ;
659659 size_t slot2 ;
660660 XLogRecPtr new_lsn ;
@@ -676,8 +676,8 @@ ptrack_mark_block(RelFileNodeBackend smgr_rnode,
676676 bid .blocknum = blocknum ;
677677
678678 hash = BID_HASH_FUNC (bid );
679- slot1 = hash % PtrackContentNblocks ;
680- slot2 = (( hash << 32 ) | (hash >> 32 )) % PtrackContentNblocks ;
679+ slot1 = ( size_t )( hash % PtrackContentNblocks ) ;
680+ slot2 = (size_t )((( hash << 32 ) | (hash >> 32 )) % PtrackContentNblocks ) ;
681681
682682 if (RecoveryInProgress ())
683683 new_lsn = GetXLogReplayRecPtr (NULL );
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ typedef PtrackMapHdr * PtrackMap;
8686/* Block address 'bid' to hash. To get slot position in map should be divided
8787 * with '% PtrackContentNblocks' */
8888#define BID_HASH_FUNC (bid ) \
89- (size_t)( DatumGetUInt64(hash_any_extended((unsigned char *)&bid, sizeof(bid), 0)))
89+ (DatumGetUInt64(hash_any_extended((unsigned char *)&bid, sizeof(bid), 0)))
9090
9191/*
9292 * Per process pointer to shared ptrack_map
Original file line number Diff line number Diff line change @@ -487,7 +487,7 @@ ptrack_get_pagemapset(PG_FUNCTION_ARGS)
487487
488488 while (true)
489489 {
490- size_t hash ;
490+ uint64 hash ;
491491 size_t slot1 ;
492492 size_t slot2 ;
493493 XLogRecPtr update_lsn1 ;
@@ -535,7 +535,7 @@ ptrack_get_pagemapset(PG_FUNCTION_ARGS)
535535 }
536536
537537 hash = BID_HASH_FUNC (ctx -> bid );
538- slot1 = hash % PtrackContentNblocks ;
538+ slot1 = ( size_t )( hash % PtrackContentNblocks ) ;
539539
540540 update_lsn1 = pg_atomic_read_u64 (& ptrack_map -> entries [slot1 ]);
541541
@@ -547,7 +547,7 @@ ptrack_get_pagemapset(PG_FUNCTION_ARGS)
547547 /* Only probe the second slot if the first one is marked */
548548 if (update_lsn1 >= ctx -> lsn )
549549 {
550- slot2 = (( hash << 32 ) | (hash >> 32 )) % PtrackContentNblocks ;
550+ slot2 = (size_t )((( hash << 32 ) | (hash >> 32 )) % PtrackContentNblocks ) ;
551551 update_lsn2 = pg_atomic_read_u64 (& ptrack_map -> entries [slot2 ]);
552552
553553 if (update_lsn2 != InvalidXLogRecPtr )
You can’t perform that action at this time.
0 commit comments