@@ -388,7 +388,7 @@ static void ReleasePredXact(SERIALIZABLEXACT *sxact);
388
388
static SERIALIZABLEXACT * FirstPredXact (void );
389
389
static SERIALIZABLEXACT * NextPredXact (SERIALIZABLEXACT * sxact );
390
390
391
- static bool RWConflictExists (const SERIALIZABLEXACT * reader , const SERIALIZABLEXACT * writer );
391
+ static bool RWConflictExists (SERIALIZABLEXACT * reader , SERIALIZABLEXACT * writer );
392
392
static void SetRWConflict (SERIALIZABLEXACT * reader , SERIALIZABLEXACT * writer );
393
393
static void SetPossibleUnsafeConflict (SERIALIZABLEXACT * roXact , SERIALIZABLEXACT * activeXact );
394
394
static void ReleaseRWConflict (RWConflict conflict );
@@ -404,27 +404,27 @@ static uint32 predicatelock_hash(const void *key, Size keysize);
404
404
static void SummarizeOldestCommittedSxact (void );
405
405
static Snapshot GetSafeSnapshot (Snapshot snapshot );
406
406
static Snapshot RegisterSerializableTransactionInt (Snapshot snapshot );
407
- static bool PredicateLockExists (const PREDICATELOCKTARGETTAG * targettag );
408
- static bool GetParentPredicateLockTag (const PREDICATELOCKTARGETTAG * tag ,
407
+ static bool PredicateLockExists (PREDICATELOCKTARGETTAG * targettag );
408
+ static bool GetParentPredicateLockTag (PREDICATELOCKTARGETTAG * tag ,
409
409
PREDICATELOCKTARGETTAG * parent );
410
- static bool CoarserLockCovers (const PREDICATELOCKTARGETTAG * newtargettag );
410
+ static bool CoarserLockCovers (PREDICATELOCKTARGETTAG * newtargettag );
411
411
static void RemoveScratchTarget (bool lockheld );
412
412
static void RestoreScratchTarget (bool lockheld );
413
413
static void RemoveTargetIfNoLongerUsed (PREDICATELOCKTARGET * target ,
414
414
uint32 targettaghash );
415
- static void DeleteChildTargetLocks (const PREDICATELOCKTARGETTAG * newtargettag );
416
- static int PredicateLockPromotionThreshold (const PREDICATELOCKTARGETTAG * tag );
417
- static bool CheckAndPromotePredicateLockRequest (const PREDICATELOCKTARGETTAG * reqtag );
418
- static void DecrementParentLocks (const PREDICATELOCKTARGETTAG * targettag );
419
- static void CreatePredicateLock (const PREDICATELOCKTARGETTAG * targettag ,
415
+ static void DeleteChildTargetLocks (PREDICATELOCKTARGETTAG * newtargettag );
416
+ static int PredicateLockPromotionThreshold (PREDICATELOCKTARGETTAG * tag );
417
+ static bool CheckAndPromotePredicateLockRequest (PREDICATELOCKTARGETTAG * reqtag );
418
+ static void DecrementParentLocks (PREDICATELOCKTARGETTAG * targettag );
419
+ static void CreatePredicateLock (PREDICATELOCKTARGETTAG * targettag ,
420
420
uint32 targettaghash ,
421
421
SERIALIZABLEXACT * sxact );
422
422
static void DeleteLockTarget (PREDICATELOCKTARGET * target , uint32 targettaghash );
423
- static bool TransferPredicateLocksToNewTarget (const PREDICATELOCKTARGETTAG oldtargettag ,
424
- const PREDICATELOCKTARGETTAG newtargettag ,
423
+ static bool TransferPredicateLocksToNewTarget (PREDICATELOCKTARGETTAG oldtargettag ,
424
+ PREDICATELOCKTARGETTAG newtargettag ,
425
425
bool removeOld );
426
- static void PredicateLockAcquire (const PREDICATELOCKTARGETTAG * targettag );
427
- static void DropAllPredicateLocksFromTable (const Relation relation ,
426
+ static void PredicateLockAcquire (PREDICATELOCKTARGETTAG * targettag );
427
+ static void DropAllPredicateLocksFromTable (Relation relation ,
428
428
bool transfer );
429
429
static void SetNewSxactGlobalXmin (void );
430
430
static void ClearOldPredicateLocks (void );
@@ -433,7 +433,7 @@ static void ReleaseOneSerializableXact(SERIALIZABLEXACT *sxact, bool partial,
433
433
static bool XidIsConcurrent (TransactionId xid );
434
434
static void CheckTargetForConflictsIn (PREDICATELOCKTARGETTAG * targettag );
435
435
static void FlagRWConflict (SERIALIZABLEXACT * reader , SERIALIZABLEXACT * writer );
436
- static void OnConflict_CheckForSerializationFailure (const SERIALIZABLEXACT * reader ,
436
+ static void OnConflict_CheckForSerializationFailure (SERIALIZABLEXACT * reader ,
437
437
SERIALIZABLEXACT * writer );
438
438
439
439
@@ -601,7 +601,7 @@ NextPredXact(SERIALIZABLEXACT *sxact)
601
601
* These functions manage primitive access to the RWConflict pool and lists.
602
602
*/
603
603
static bool
604
- RWConflictExists (const SERIALIZABLEXACT * reader , const SERIALIZABLEXACT * writer )
604
+ RWConflictExists (SERIALIZABLEXACT * reader , SERIALIZABLEXACT * writer )
605
605
{
606
606
RWConflict conflict ;
607
607
@@ -1337,7 +1337,7 @@ PredicateLockShmemSize(void)
1337
1337
static uint32
1338
1338
predicatelock_hash (const void * key , Size keysize )
1339
1339
{
1340
- const PREDICATELOCKTAG * predicatelocktag = (const PREDICATELOCKTAG * ) key ;
1340
+ PREDICATELOCKTAG * predicatelocktag = (PREDICATELOCKTAG * ) key ;
1341
1341
uint32 targethash ;
1342
1342
1343
1343
Assert (keysize == sizeof (PREDICATELOCKTAG ));
@@ -1699,7 +1699,7 @@ RegisterSerializableTransactionInt(Snapshot snapshot)
1699
1699
* Also store it for easy reference in MySerializableXact.
1700
1700
*/
1701
1701
void
1702
- RegisterPredicateLockingXid (const TransactionId xid )
1702
+ RegisterPredicateLockingXid (TransactionId xid )
1703
1703
{
1704
1704
SERIALIZABLEXIDTAG sxidtag ;
1705
1705
SERIALIZABLEXID * sxid ;
@@ -1748,7 +1748,7 @@ RegisterPredicateLockingXid(const TransactionId xid)
1748
1748
* One use is to support proper behavior during GiST index vacuum.
1749
1749
*/
1750
1750
bool
1751
- PageIsPredicateLocked (const Relation relation , const BlockNumber blkno )
1751
+ PageIsPredicateLocked (Relation relation , BlockNumber blkno )
1752
1752
{
1753
1753
PREDICATELOCKTARGETTAG targettag ;
1754
1754
uint32 targettaghash ;
@@ -1785,7 +1785,7 @@ PageIsPredicateLocked(const Relation relation, const BlockNumber blkno)
1785
1785
* acceptable!
1786
1786
*/
1787
1787
static bool
1788
- PredicateLockExists (const PREDICATELOCKTARGETTAG * targettag )
1788
+ PredicateLockExists (PREDICATELOCKTARGETTAG * targettag )
1789
1789
{
1790
1790
LOCALPREDICATELOCK * lock ;
1791
1791
@@ -1812,7 +1812,7 @@ PredicateLockExists(const PREDICATELOCKTARGETTAG *targettag)
1812
1812
* returns false if none exists.
1813
1813
*/
1814
1814
static bool
1815
- GetParentPredicateLockTag (const PREDICATELOCKTARGETTAG * tag ,
1815
+ GetParentPredicateLockTag (PREDICATELOCKTARGETTAG * tag ,
1816
1816
PREDICATELOCKTARGETTAG * parent )
1817
1817
{
1818
1818
switch (GET_PREDICATELOCKTARGETTAG_TYPE (* tag ))
@@ -1851,7 +1851,7 @@ GetParentPredicateLockTag(const PREDICATELOCKTARGETTAG *tag,
1851
1851
* negative, but it will never return a false positive.
1852
1852
*/
1853
1853
static bool
1854
- CoarserLockCovers (const PREDICATELOCKTARGETTAG * newtargettag )
1854
+ CoarserLockCovers (PREDICATELOCKTARGETTAG * newtargettag )
1855
1855
{
1856
1856
PREDICATELOCKTARGETTAG targettag ,
1857
1857
parenttag ;
@@ -1952,7 +1952,7 @@ RemoveTargetIfNoLongerUsed(PREDICATELOCKTARGET *target, uint32 targettaghash)
1952
1952
* locks.
1953
1953
*/
1954
1954
static void
1955
- DeleteChildTargetLocks (const PREDICATELOCKTARGETTAG * newtargettag )
1955
+ DeleteChildTargetLocks (PREDICATELOCKTARGETTAG * newtargettag )
1956
1956
{
1957
1957
SERIALIZABLEXACT * sxact ;
1958
1958
PREDICATELOCK * predlock ;
@@ -2029,7 +2029,7 @@ DeleteChildTargetLocks(const PREDICATELOCKTARGETTAG *newtargettag)
2029
2029
* entirely arbitrarily (and without benchmarking).
2030
2030
*/
2031
2031
static int
2032
- PredicateLockPromotionThreshold (const PREDICATELOCKTARGETTAG * tag )
2032
+ PredicateLockPromotionThreshold (PREDICATELOCKTARGETTAG * tag )
2033
2033
{
2034
2034
switch (GET_PREDICATELOCKTARGETTAG_TYPE (* tag ))
2035
2035
{
@@ -2063,7 +2063,7 @@ PredicateLockPromotionThreshold(const PREDICATELOCKTARGETTAG *tag)
2063
2063
* Returns true if a parent lock was acquired and false otherwise.
2064
2064
*/
2065
2065
static bool
2066
- CheckAndPromotePredicateLockRequest (const PREDICATELOCKTARGETTAG * reqtag )
2066
+ CheckAndPromotePredicateLockRequest (PREDICATELOCKTARGETTAG * reqtag )
2067
2067
{
2068
2068
PREDICATELOCKTARGETTAG targettag ,
2069
2069
nexttag ,
@@ -2128,7 +2128,7 @@ CheckAndPromotePredicateLockRequest(const PREDICATELOCKTARGETTAG *reqtag)
2128
2128
* this information is no longer needed.
2129
2129
*/
2130
2130
static void
2131
- DecrementParentLocks (const PREDICATELOCKTARGETTAG * targettag )
2131
+ DecrementParentLocks (PREDICATELOCKTARGETTAG * targettag )
2132
2132
{
2133
2133
PREDICATELOCKTARGETTAG parenttag ,
2134
2134
nexttag ;
@@ -2190,7 +2190,7 @@ DecrementParentLocks(const PREDICATELOCKTARGETTAG *targettag)
2190
2190
* PredicateLockAcquire for that.
2191
2191
*/
2192
2192
static void
2193
- CreatePredicateLock (const PREDICATELOCKTARGETTAG * targettag ,
2193
+ CreatePredicateLock (PREDICATELOCKTARGETTAG * targettag ,
2194
2194
uint32 targettaghash ,
2195
2195
SERIALIZABLEXACT * sxact )
2196
2196
{
@@ -2251,7 +2251,7 @@ CreatePredicateLock(const PREDICATELOCKTARGETTAG *targettag,
2251
2251
* any finer-grained locks covered by the new one.
2252
2252
*/
2253
2253
static void
2254
- PredicateLockAcquire (const PREDICATELOCKTARGETTAG * targettag )
2254
+ PredicateLockAcquire (PREDICATELOCKTARGETTAG * targettag )
2255
2255
{
2256
2256
uint32 targettaghash ;
2257
2257
bool found ;
@@ -2310,7 +2310,7 @@ PredicateLockAcquire(const PREDICATELOCKTARGETTAG *targettag)
2310
2310
* Clear any finer-grained predicate locks this session has on the relation.
2311
2311
*/
2312
2312
void
2313
- PredicateLockRelation (const Relation relation , const Snapshot snapshot )
2313
+ PredicateLockRelation (Relation relation , Snapshot snapshot )
2314
2314
{
2315
2315
PREDICATELOCKTARGETTAG tag ;
2316
2316
@@ -2333,8 +2333,7 @@ PredicateLockRelation(const Relation relation, const Snapshot snapshot)
2333
2333
* Clear any finer-grained predicate locks this session has on the relation.
2334
2334
*/
2335
2335
void
2336
- PredicateLockPage (const Relation relation , const BlockNumber blkno ,
2337
- const Snapshot snapshot )
2336
+ PredicateLockPage (Relation relation , BlockNumber blkno , Snapshot snapshot )
2338
2337
{
2339
2338
PREDICATELOCKTARGETTAG tag ;
2340
2339
@@ -2356,8 +2355,7 @@ PredicateLockPage(const Relation relation, const BlockNumber blkno,
2356
2355
* Skip if this is a temporary table.
2357
2356
*/
2358
2357
void
2359
- PredicateLockTuple (const Relation relation , const HeapTuple tuple ,
2360
- const Snapshot snapshot )
2358
+ PredicateLockTuple (Relation relation , HeapTuple tuple , Snapshot snapshot )
2361
2359
{
2362
2360
PREDICATELOCKTARGETTAG tag ;
2363
2361
ItemPointer tid ;
@@ -2495,8 +2493,8 @@ DeleteLockTarget(PREDICATELOCKTARGET *target, uint32 targettaghash)
2495
2493
* Caller must hold SerializablePredicateLockListLock.
2496
2494
*/
2497
2495
static bool
2498
- TransferPredicateLocksToNewTarget (const PREDICATELOCKTARGETTAG oldtargettag ,
2499
- const PREDICATELOCKTARGETTAG newtargettag ,
2496
+ TransferPredicateLocksToNewTarget (PREDICATELOCKTARGETTAG oldtargettag ,
2497
+ PREDICATELOCKTARGETTAG newtargettag ,
2500
2498
bool removeOld )
2501
2499
{
2502
2500
uint32 oldtargettaghash ;
@@ -2712,7 +2710,7 @@ TransferPredicateLocksToNewTarget(const PREDICATELOCKTARGETTAG oldtargettag,
2712
2710
* transaction which executed DROP TABLE, the false condition will be useful.
2713
2711
*/
2714
2712
static void
2715
- DropAllPredicateLocksFromTable (const Relation relation , bool transfer )
2713
+ DropAllPredicateLocksFromTable (Relation relation , bool transfer )
2716
2714
{
2717
2715
HASH_SEQ_STATUS seqstat ;
2718
2716
PREDICATELOCKTARGET * oldtarget ;
@@ -2908,7 +2906,7 @@ DropAllPredicateLocksFromTable(const Relation relation, bool transfer)
2908
2906
* relation to a single relation lock on the heap.
2909
2907
*/
2910
2908
void
2911
- TransferPredicateLocksToHeapRelation (const Relation relation )
2909
+ TransferPredicateLocksToHeapRelation (Relation relation )
2912
2910
{
2913
2911
DropAllPredicateLocksFromTable (relation , true);
2914
2912
}
@@ -2929,8 +2927,8 @@ TransferPredicateLocksToHeapRelation(const Relation relation)
2929
2927
* which hold the locks getting in and noticing.
2930
2928
*/
2931
2929
void
2932
- PredicateLockPageSplit (const Relation relation , const BlockNumber oldblkno ,
2933
- const BlockNumber newblkno )
2930
+ PredicateLockPageSplit (Relation relation , BlockNumber oldblkno ,
2931
+ BlockNumber newblkno )
2934
2932
{
2935
2933
PREDICATELOCKTARGETTAG oldtargettag ;
2936
2934
PREDICATELOCKTARGETTAG newtargettag ;
@@ -3014,8 +3012,8 @@ PredicateLockPageSplit(const Relation relation, const BlockNumber oldblkno,
3014
3012
* occurs in the context of another transaction isolation level.
3015
3013
*/
3016
3014
void
3017
- PredicateLockPageCombine (const Relation relation , const BlockNumber oldblkno ,
3018
- const BlockNumber newblkno )
3015
+ PredicateLockPageCombine (Relation relation , BlockNumber oldblkno ,
3016
+ BlockNumber newblkno )
3019
3017
{
3020
3018
/*
3021
3019
* Page combines differ from page splits in that we ought to be able to
@@ -3086,7 +3084,7 @@ SetNewSxactGlobalXmin(void)
3086
3084
* holding locks.
3087
3085
*/
3088
3086
void
3089
- ReleasePredicateLocks (const bool isCommit )
3087
+ ReleasePredicateLocks (bool isCommit )
3090
3088
{
3091
3089
bool needToClear ;
3092
3090
RWConflict conflict ,
@@ -3736,9 +3734,9 @@ XidIsConcurrent(TransactionId xid)
3736
3734
* currently no known reason to call this function from an index AM.
3737
3735
*/
3738
3736
void
3739
- CheckForSerializableConflictOut (const bool visible , const Relation relation ,
3740
- const HeapTuple tuple , const Buffer buffer ,
3741
- const Snapshot snapshot )
3737
+ CheckForSerializableConflictOut (bool visible , Relation relation ,
3738
+ HeapTuple tuple , Buffer buffer ,
3739
+ Snapshot snapshot )
3742
3740
{
3743
3741
TransactionId xid ;
3744
3742
SERIALIZABLEXIDTAG sxidtag ;
@@ -4117,8 +4115,8 @@ CheckTargetForConflictsIn(PREDICATELOCKTARGETTAG *targettag)
4117
4115
* tuple itself.
4118
4116
*/
4119
4117
void
4120
- CheckForSerializableConflictIn (const Relation relation , const HeapTuple tuple ,
4121
- const Buffer buffer )
4118
+ CheckForSerializableConflictIn (Relation relation , HeapTuple tuple ,
4119
+ Buffer buffer )
4122
4120
{
4123
4121
PREDICATELOCKTARGETTAG targettag ;
4124
4122
@@ -4202,7 +4200,7 @@ CheckForSerializableConflictIn(const Relation relation, const HeapTuple tuple,
4202
4200
* lead to some false positives, but it doesn't seem worth the trouble.)
4203
4201
*/
4204
4202
void
4205
- CheckTableForSerializableConflictIn (const Relation relation )
4203
+ CheckTableForSerializableConflictIn (Relation relation )
4206
4204
{
4207
4205
HASH_SEQ_STATUS seqstat ;
4208
4206
PREDICATELOCKTARGET * target ;
@@ -4329,7 +4327,7 @@ FlagRWConflict(SERIALIZABLEXACT *reader, SERIALIZABLEXACT *writer)
4329
4327
*----------------------------------------------------------------------------
4330
4328
*/
4331
4329
static void
4332
- OnConflict_CheckForSerializationFailure (const SERIALIZABLEXACT * reader ,
4330
+ OnConflict_CheckForSerializationFailure (SERIALIZABLEXACT * reader ,
4333
4331
SERIALIZABLEXACT * writer )
4334
4332
{
4335
4333
bool failure ;
0 commit comments