@@ -465,7 +465,7 @@ static Buffer ReadBuffer_common(SMgrRelation smgr, char relpersistence,
465
465
bool * hit );
466
466
static bool PinBuffer (BufferDesc * buf , BufferAccessStrategy strategy );
467
467
static void PinBuffer_Locked (BufferDesc * buf );
468
- static void UnpinBuffer (BufferDesc * buf , bool fixOwner );
468
+ static void UnpinBuffer (BufferDesc * buf );
469
469
static void BufferSync (int flags );
470
470
static uint32 WaitBufHdrUnlocked (BufferDesc * buf );
471
471
static int SyncOneBuffer (int buf_id , bool skip_recently_used ,
@@ -1258,7 +1258,7 @@ BufferAlloc(SMgrRelation smgr, char relpersistence, ForkNumber forkNum,
1258
1258
{
1259
1259
/* Drop lock/pin and loop around for another buffer */
1260
1260
LWLockRelease (BufferDescriptorGetContentLock (buf ));
1261
- UnpinBuffer (buf , true );
1261
+ UnpinBuffer (buf );
1262
1262
continue ;
1263
1263
}
1264
1264
}
@@ -1286,7 +1286,7 @@ BufferAlloc(SMgrRelation smgr, char relpersistence, ForkNumber forkNum,
1286
1286
* Someone else has locked the buffer, so give it up and loop
1287
1287
* back to get another one.
1288
1288
*/
1289
- UnpinBuffer (buf , true );
1289
+ UnpinBuffer (buf );
1290
1290
continue ;
1291
1291
}
1292
1292
}
@@ -1353,7 +1353,7 @@ BufferAlloc(SMgrRelation smgr, char relpersistence, ForkNumber forkNum,
1353
1353
* pool in the first place. First, give up the buffer we were
1354
1354
* planning to use.
1355
1355
*/
1356
- UnpinBuffer (buf , true );
1356
+ UnpinBuffer (buf );
1357
1357
1358
1358
/* Can give up that buffer's mapping partition lock now */
1359
1359
if (oldPartitionLock != NULL &&
@@ -1414,7 +1414,7 @@ BufferAlloc(SMgrRelation smgr, char relpersistence, ForkNumber forkNum,
1414
1414
oldPartitionLock != newPartitionLock )
1415
1415
LWLockRelease (oldPartitionLock );
1416
1416
LWLockRelease (newPartitionLock );
1417
- UnpinBuffer (buf , true );
1417
+ UnpinBuffer (buf );
1418
1418
}
1419
1419
1420
1420
/*
@@ -1671,7 +1671,7 @@ ReleaseAndReadBuffer(Buffer buffer,
1671
1671
BufTagMatchesRelFileLocator (& bufHdr -> tag , & relation -> rd_locator ) &&
1672
1672
BufTagGetForkNum (& bufHdr -> tag ) == forkNum )
1673
1673
return buffer ;
1674
- UnpinBuffer (bufHdr , true );
1674
+ UnpinBuffer (bufHdr );
1675
1675
}
1676
1676
}
1677
1677
@@ -1843,13 +1843,11 @@ PinBuffer_Locked(BufferDesc *buf)
1843
1843
/*
1844
1844
* UnpinBuffer -- make buffer available for replacement.
1845
1845
*
1846
- * This should be applied only to shared buffers, never local ones.
1847
- *
1848
- * Most but not all callers want CurrentResourceOwner to be adjusted.
1849
- * Those that don't should pass fixOwner = false.
1846
+ * This should be applied only to shared buffers, never local ones. This
1847
+ * always adjusts CurrentResourceOwner.
1850
1848
*/
1851
1849
static void
1852
- UnpinBuffer (BufferDesc * buf , bool fixOwner )
1850
+ UnpinBuffer (BufferDesc * buf )
1853
1851
{
1854
1852
PrivateRefCountEntry * ref ;
1855
1853
Buffer b = BufferDescriptorGetBuffer (buf );
@@ -1858,8 +1856,7 @@ UnpinBuffer(BufferDesc *buf, bool fixOwner)
1858
1856
ref = GetPrivateRefCountEntry (b , false);
1859
1857
Assert (ref != NULL );
1860
1858
1861
- if (fixOwner )
1862
- ResourceOwnerForgetBuffer (CurrentResourceOwner , b );
1859
+ ResourceOwnerForgetBuffer (CurrentResourceOwner , b );
1863
1860
1864
1861
Assert (ref -> refcount > 0 );
1865
1862
ref -> refcount -- ;
@@ -2579,7 +2576,7 @@ SyncOneBuffer(int buf_id, bool skip_recently_used, WritebackContext *wb_context)
2579
2576
2580
2577
tag = bufHdr -> tag ;
2581
2578
2582
- UnpinBuffer (bufHdr , true );
2579
+ UnpinBuffer (bufHdr );
2583
2580
2584
2581
ScheduleBufferTagForWriteback (wb_context , & tag );
2585
2582
@@ -3591,7 +3588,7 @@ FlushRelationBuffers(Relation rel)
3591
3588
LWLockAcquire (BufferDescriptorGetContentLock (bufHdr ), LW_SHARED );
3592
3589
FlushBuffer (bufHdr , RelationGetSmgr (rel ));
3593
3590
LWLockRelease (BufferDescriptorGetContentLock (bufHdr ));
3594
- UnpinBuffer (bufHdr , true );
3591
+ UnpinBuffer (bufHdr );
3595
3592
}
3596
3593
else
3597
3594
UnlockBufHdr (bufHdr , buf_state );
@@ -3689,7 +3686,7 @@ FlushRelationsAllBuffers(SMgrRelation *smgrs, int nrels)
3689
3686
LWLockAcquire (BufferDescriptorGetContentLock (bufHdr ), LW_SHARED );
3690
3687
FlushBuffer (bufHdr , srelent -> srel );
3691
3688
LWLockRelease (BufferDescriptorGetContentLock (bufHdr ));
3692
- UnpinBuffer (bufHdr , true );
3689
+ UnpinBuffer (bufHdr );
3693
3690
}
3694
3691
else
3695
3692
UnlockBufHdr (bufHdr , buf_state );
@@ -3899,7 +3896,7 @@ FlushDatabaseBuffers(Oid dbid)
3899
3896
LWLockAcquire (BufferDescriptorGetContentLock (bufHdr ), LW_SHARED );
3900
3897
FlushBuffer (bufHdr , NULL );
3901
3898
LWLockRelease (BufferDescriptorGetContentLock (bufHdr ));
3902
- UnpinBuffer (bufHdr , true );
3899
+ UnpinBuffer (bufHdr );
3903
3900
}
3904
3901
else
3905
3902
UnlockBufHdr (bufHdr , buf_state );
@@ -3945,7 +3942,7 @@ ReleaseBuffer(Buffer buffer)
3945
3942
return ;
3946
3943
}
3947
3944
3948
- UnpinBuffer (GetBufferDescriptor (buffer - 1 ), true );
3945
+ UnpinBuffer (GetBufferDescriptor (buffer - 1 ));
3949
3946
}
3950
3947
3951
3948
/*
0 commit comments