@@ -92,11 +92,11 @@ int effective_io_concurrency = 0;
92
92
int target_prefetch_pages = 0 ;
93
93
94
94
/* local state for StartBufferIO and related functions */
95
- static volatile BufferDesc * InProgressBuf = NULL ;
95
+ static BufferDesc * InProgressBuf = NULL ;
96
96
static bool IsForInput ;
97
97
98
98
/* local state for LockBufferForCleanup */
99
- static volatile BufferDesc * PinCountWaitBuf = NULL ;
99
+ static BufferDesc * PinCountWaitBuf = NULL ;
100
100
101
101
/*
102
102
* Backend-Private refcount management:
@@ -395,24 +395,24 @@ static Buffer ReadBuffer_common(SMgrRelation reln, char relpersistence,
395
395
ForkNumber forkNum , BlockNumber blockNum ,
396
396
ReadBufferMode mode , BufferAccessStrategy strategy ,
397
397
bool * hit );
398
- static bool PinBuffer (volatile BufferDesc * buf , BufferAccessStrategy strategy );
399
- static void PinBuffer_Locked (volatile BufferDesc * buf );
400
- static void UnpinBuffer (volatile BufferDesc * buf , bool fixOwner );
398
+ static bool PinBuffer (BufferDesc * buf , BufferAccessStrategy strategy );
399
+ static void PinBuffer_Locked (BufferDesc * buf );
400
+ static void UnpinBuffer (BufferDesc * buf , bool fixOwner );
401
401
static void BufferSync (int flags );
402
402
static int SyncOneBuffer (int buf_id , bool skip_recently_used );
403
- static void WaitIO (volatile BufferDesc * buf );
404
- static bool StartBufferIO (volatile BufferDesc * buf , bool forInput );
405
- static void TerminateBufferIO (volatile BufferDesc * buf , bool clear_dirty ,
403
+ static void WaitIO (BufferDesc * buf );
404
+ static bool StartBufferIO (BufferDesc * buf , bool forInput );
405
+ static void TerminateBufferIO (BufferDesc * buf , bool clear_dirty ,
406
406
int set_flag_bits );
407
407
static void shared_buffer_write_error_callback (void * arg );
408
408
static void local_buffer_write_error_callback (void * arg );
409
- static volatile BufferDesc * BufferAlloc (SMgrRelation smgr ,
409
+ static BufferDesc * BufferAlloc (SMgrRelation smgr ,
410
410
char relpersistence ,
411
411
ForkNumber forkNum ,
412
412
BlockNumber blockNum ,
413
413
BufferAccessStrategy strategy ,
414
414
bool * foundPtr );
415
- static void FlushBuffer (volatile BufferDesc * buf , SMgrRelation reln );
415
+ static void FlushBuffer (BufferDesc * buf , SMgrRelation reln );
416
416
static void AtProcExit_Buffers (int code , Datum arg );
417
417
static void CheckForBufferLeaks (void );
418
418
static int rnode_comparator (const void * p1 , const void * p2 );
@@ -663,7 +663,7 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum,
663
663
BlockNumber blockNum , ReadBufferMode mode ,
664
664
BufferAccessStrategy strategy , bool * hit )
665
665
{
666
- volatile BufferDesc * bufHdr ;
666
+ BufferDesc * bufHdr ;
667
667
Block bufBlock ;
668
668
bool found ;
669
669
bool isExtend ;
@@ -927,7 +927,7 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum,
927
927
*
928
928
* No locks are held either at entry or exit.
929
929
*/
930
- static volatile BufferDesc *
930
+ static BufferDesc *
931
931
BufferAlloc (SMgrRelation smgr , char relpersistence , ForkNumber forkNum ,
932
932
BlockNumber blockNum ,
933
933
BufferAccessStrategy strategy ,
@@ -941,7 +941,7 @@ BufferAlloc(SMgrRelation smgr, char relpersistence, ForkNumber forkNum,
941
941
LWLock * oldPartitionLock ; /* buffer partition lock for it */
942
942
BufFlags oldFlags ;
943
943
int buf_id ;
944
- volatile BufferDesc * buf ;
944
+ BufferDesc * buf ;
945
945
bool valid ;
946
946
947
947
/* create a tag so we can lookup the buffer */
@@ -1281,7 +1281,7 @@ BufferAlloc(SMgrRelation smgr, char relpersistence, ForkNumber forkNum,
1281
1281
* to acquire the necessary locks; if so, don't mess it up.
1282
1282
*/
1283
1283
static void
1284
- InvalidateBuffer (volatile BufferDesc * buf )
1284
+ InvalidateBuffer (BufferDesc * buf )
1285
1285
{
1286
1286
BufferTag oldTag ;
1287
1287
uint32 oldHash ; /* hash value for oldTag */
@@ -1380,7 +1380,7 @@ InvalidateBuffer(volatile BufferDesc *buf)
1380
1380
void
1381
1381
MarkBufferDirty (Buffer buffer )
1382
1382
{
1383
- volatile BufferDesc * bufHdr ;
1383
+ BufferDesc * bufHdr ;
1384
1384
1385
1385
if (!BufferIsValid (buffer ))
1386
1386
elog (ERROR , "bad buffer ID: %d" , buffer );
@@ -1436,7 +1436,7 @@ ReleaseAndReadBuffer(Buffer buffer,
1436
1436
BlockNumber blockNum )
1437
1437
{
1438
1438
ForkNumber forkNum = MAIN_FORKNUM ;
1439
- volatile BufferDesc * bufHdr ;
1439
+ BufferDesc * bufHdr ;
1440
1440
1441
1441
if (BufferIsValid (buffer ))
1442
1442
{
@@ -1485,7 +1485,7 @@ ReleaseAndReadBuffer(Buffer buffer,
1485
1485
* some callers to avoid an extra spinlock cycle.
1486
1486
*/
1487
1487
static bool
1488
- PinBuffer (volatile BufferDesc * buf , BufferAccessStrategy strategy )
1488
+ PinBuffer (BufferDesc * buf , BufferAccessStrategy strategy )
1489
1489
{
1490
1490
Buffer b = BufferDescriptorGetBuffer (buf );
1491
1491
bool result ;
@@ -1547,7 +1547,7 @@ PinBuffer(volatile BufferDesc *buf, BufferAccessStrategy strategy)
1547
1547
* its state can change under us.
1548
1548
*/
1549
1549
static void
1550
- PinBuffer_Locked (volatile BufferDesc * buf )
1550
+ PinBuffer_Locked (BufferDesc * buf )
1551
1551
{
1552
1552
Buffer b ;
1553
1553
PrivateRefCountEntry * ref ;
@@ -1578,7 +1578,7 @@ PinBuffer_Locked(volatile BufferDesc *buf)
1578
1578
* Those that don't should pass fixOwner = FALSE.
1579
1579
*/
1580
1580
static void
1581
- UnpinBuffer (volatile BufferDesc * buf , bool fixOwner )
1581
+ UnpinBuffer (BufferDesc * buf , bool fixOwner )
1582
1582
{
1583
1583
PrivateRefCountEntry * ref ;
1584
1584
Buffer b = BufferDescriptorGetBuffer (buf );
@@ -1672,7 +1672,7 @@ BufferSync(int flags)
1672
1672
num_to_write = 0 ;
1673
1673
for (buf_id = 0 ; buf_id < NBuffers ; buf_id ++ )
1674
1674
{
1675
- volatile BufferDesc * bufHdr = GetBufferDescriptor (buf_id );
1675
+ BufferDesc * bufHdr = GetBufferDescriptor (buf_id );
1676
1676
1677
1677
/*
1678
1678
* Header spinlock is enough to examine BM_DIRTY, see comment in
@@ -1707,7 +1707,7 @@ BufferSync(int flags)
1707
1707
num_written = 0 ;
1708
1708
while (num_to_scan -- > 0 )
1709
1709
{
1710
- volatile BufferDesc * bufHdr = GetBufferDescriptor (buf_id );
1710
+ BufferDesc * bufHdr = GetBufferDescriptor (buf_id );
1711
1711
1712
1712
/*
1713
1713
* We don't need to acquire the lock here, because we're only looking
@@ -2079,7 +2079,7 @@ BgBufferSync(void)
2079
2079
static int
2080
2080
SyncOneBuffer (int buf_id , bool skip_recently_used )
2081
2081
{
2082
- volatile BufferDesc * bufHdr = GetBufferDescriptor (buf_id );
2082
+ BufferDesc * bufHdr = GetBufferDescriptor (buf_id );
2083
2083
int result = 0 ;
2084
2084
2085
2085
ReservePrivateRefCountEntry ();
@@ -2252,7 +2252,7 @@ CheckForBufferLeaks(void)
2252
2252
void
2253
2253
PrintBufferLeakWarning (Buffer buffer )
2254
2254
{
2255
- volatile BufferDesc * buf ;
2255
+ BufferDesc * buf ;
2256
2256
int32 loccount ;
2257
2257
char * path ;
2258
2258
BackendId backend ;
@@ -2324,7 +2324,7 @@ BufmgrCommit(void)
2324
2324
BlockNumber
2325
2325
BufferGetBlockNumber (Buffer buffer )
2326
2326
{
2327
- volatile BufferDesc * bufHdr ;
2327
+ BufferDesc * bufHdr ;
2328
2328
2329
2329
Assert (BufferIsPinned (buffer ));
2330
2330
@@ -2346,7 +2346,7 @@ void
2346
2346
BufferGetTag (Buffer buffer , RelFileNode * rnode , ForkNumber * forknum ,
2347
2347
BlockNumber * blknum )
2348
2348
{
2349
- volatile BufferDesc * bufHdr ;
2349
+ BufferDesc * bufHdr ;
2350
2350
2351
2351
/* Do the same checks as BufferGetBlockNumber. */
2352
2352
Assert (BufferIsPinned (buffer ));
@@ -2382,7 +2382,7 @@ BufferGetTag(Buffer buffer, RelFileNode *rnode, ForkNumber *forknum,
2382
2382
* as the second parameter. If not, pass NULL.
2383
2383
*/
2384
2384
static void
2385
- FlushBuffer (volatile BufferDesc * buf , SMgrRelation reln )
2385
+ FlushBuffer (BufferDesc * buf , SMgrRelation reln )
2386
2386
{
2387
2387
XLogRecPtr recptr ;
2388
2388
ErrorContextCallback errcallback ;
@@ -2520,7 +2520,7 @@ RelationGetNumberOfBlocksInFork(Relation relation, ForkNumber forkNum)
2520
2520
bool
2521
2521
BufferIsPermanent (Buffer buffer )
2522
2522
{
2523
- volatile BufferDesc * bufHdr ;
2523
+ BufferDesc * bufHdr ;
2524
2524
2525
2525
/* Local buffers are used only for temp relations. */
2526
2526
if (BufferIsLocal (buffer ))
@@ -2550,7 +2550,7 @@ BufferIsPermanent(Buffer buffer)
2550
2550
XLogRecPtr
2551
2551
BufferGetLSNAtomic (Buffer buffer )
2552
2552
{
2553
- volatile BufferDesc * bufHdr = GetBufferDescriptor (buffer - 1 );
2553
+ BufferDesc * bufHdr = GetBufferDescriptor (buffer - 1 );
2554
2554
char * page = BufferGetPage (buffer );
2555
2555
XLogRecPtr lsn ;
2556
2556
@@ -2613,7 +2613,7 @@ DropRelFileNodeBuffers(RelFileNodeBackend rnode, ForkNumber forkNum,
2613
2613
2614
2614
for (i = 0 ; i < NBuffers ; i ++ )
2615
2615
{
2616
- volatile BufferDesc * bufHdr = GetBufferDescriptor (i );
2616
+ BufferDesc * bufHdr = GetBufferDescriptor (i );
2617
2617
2618
2618
/*
2619
2619
* We can make this a tad faster by prechecking the buffer tag before
@@ -2703,7 +2703,7 @@ DropRelFileNodesAllBuffers(RelFileNodeBackend *rnodes, int nnodes)
2703
2703
for (i = 0 ; i < NBuffers ; i ++ )
2704
2704
{
2705
2705
RelFileNode * rnode = NULL ;
2706
- volatile BufferDesc * bufHdr = GetBufferDescriptor (i );
2706
+ BufferDesc * bufHdr = GetBufferDescriptor (i );
2707
2707
2708
2708
/*
2709
2709
* As in DropRelFileNodeBuffers, an unlocked precheck should be safe
@@ -2767,7 +2767,7 @@ DropDatabaseBuffers(Oid dbid)
2767
2767
2768
2768
for (i = 0 ; i < NBuffers ; i ++ )
2769
2769
{
2770
- volatile BufferDesc * bufHdr = GetBufferDescriptor (i );
2770
+ BufferDesc * bufHdr = GetBufferDescriptor (i );
2771
2771
2772
2772
/*
2773
2773
* As in DropRelFileNodeBuffers, an unlocked precheck should be safe
@@ -2799,7 +2799,7 @@ PrintBufferDescs(void)
2799
2799
2800
2800
for (i = 0 ; i < NBuffers ; ++ i )
2801
2801
{
2802
- volatile BufferDesc * buf = GetBufferDescriptor (i );
2802
+ BufferDesc * buf = GetBufferDescriptor (i );
2803
2803
Buffer b = BufferDescriptorGetBuffer (buf );
2804
2804
2805
2805
/* theoretically we should lock the bufhdr here */
@@ -2822,7 +2822,7 @@ PrintPinnedBufs(void)
2822
2822
2823
2823
for (i = 0 ; i < NBuffers ; ++ i )
2824
2824
{
2825
- volatile BufferDesc * buf = GetBufferDescriptor (i );
2825
+ BufferDesc * buf = GetBufferDescriptor (i );
2826
2826
Buffer b = BufferDescriptorGetBuffer (buf );
2827
2827
2828
2828
if (GetPrivateRefCount (b ) > 0 )
@@ -2863,7 +2863,7 @@ void
2863
2863
FlushRelationBuffers (Relation rel )
2864
2864
{
2865
2865
int i ;
2866
- volatile BufferDesc * bufHdr ;
2866
+ BufferDesc * bufHdr ;
2867
2867
2868
2868
/* Open rel at the smgr level if not already done */
2869
2869
RelationOpenSmgr (rel );
@@ -2955,7 +2955,7 @@ void
2955
2955
FlushDatabaseBuffers (Oid dbid )
2956
2956
{
2957
2957
int i ;
2958
- volatile BufferDesc * bufHdr ;
2958
+ BufferDesc * bufHdr ;
2959
2959
2960
2960
/* Make sure we can handle the pin inside the loop */
2961
2961
ResourceOwnerEnlargeBuffers (CurrentResourceOwner );
@@ -3064,7 +3064,7 @@ IncrBufferRefCount(Buffer buffer)
3064
3064
void
3065
3065
MarkBufferDirtyHint (Buffer buffer , bool buffer_std )
3066
3066
{
3067
- volatile BufferDesc * bufHdr ;
3067
+ BufferDesc * bufHdr ;
3068
3068
Page page = BufferGetPage (buffer );
3069
3069
3070
3070
if (!BufferIsValid (buffer ))
@@ -3198,7 +3198,7 @@ MarkBufferDirtyHint(Buffer buffer, bool buffer_std)
3198
3198
void
3199
3199
UnlockBuffers (void )
3200
3200
{
3201
- volatile BufferDesc * buf = PinCountWaitBuf ;
3201
+ BufferDesc * buf = PinCountWaitBuf ;
3202
3202
3203
3203
if (buf )
3204
3204
{
@@ -3224,7 +3224,7 @@ UnlockBuffers(void)
3224
3224
void
3225
3225
LockBuffer (Buffer buffer , int mode )
3226
3226
{
3227
- volatile BufferDesc * buf ;
3227
+ BufferDesc * buf ;
3228
3228
3229
3229
Assert (BufferIsValid (buffer ));
3230
3230
if (BufferIsLocal (buffer ))
@@ -3250,7 +3250,7 @@ LockBuffer(Buffer buffer, int mode)
3250
3250
bool
3251
3251
ConditionalLockBuffer (Buffer buffer )
3252
3252
{
3253
- volatile BufferDesc * buf ;
3253
+ BufferDesc * buf ;
3254
3254
3255
3255
Assert (BufferIsValid (buffer ));
3256
3256
if (BufferIsLocal (buffer ))
@@ -3280,7 +3280,7 @@ ConditionalLockBuffer(Buffer buffer)
3280
3280
void
3281
3281
LockBufferForCleanup (Buffer buffer )
3282
3282
{
3283
- volatile BufferDesc * bufHdr ;
3283
+ BufferDesc * bufHdr ;
3284
3284
3285
3285
Assert (BufferIsValid (buffer ));
3286
3286
Assert (PinCountWaitBuf == NULL );
@@ -3392,7 +3392,7 @@ HoldingBufferPinThatDelaysRecovery(void)
3392
3392
bool
3393
3393
ConditionalLockBufferForCleanup (Buffer buffer )
3394
3394
{
3395
- volatile BufferDesc * bufHdr ;
3395
+ BufferDesc * bufHdr ;
3396
3396
3397
3397
Assert (BufferIsValid (buffer ));
3398
3398
@@ -3445,7 +3445,7 @@ ConditionalLockBufferForCleanup(Buffer buffer)
3445
3445
* WaitIO -- Block until the IO_IN_PROGRESS flag on 'buf' is cleared.
3446
3446
*/
3447
3447
static void
3448
- WaitIO (volatile BufferDesc * buf )
3448
+ WaitIO (BufferDesc * buf )
3449
3449
{
3450
3450
/*
3451
3451
* Changed to wait until there's no IO - Inoue 01/13/2000
@@ -3492,7 +3492,7 @@ WaitIO(volatile BufferDesc *buf)
3492
3492
* FALSE if someone else already did the work.
3493
3493
*/
3494
3494
static bool
3495
- StartBufferIO (volatile BufferDesc * buf , bool forInput )
3495
+ StartBufferIO (BufferDesc * buf , bool forInput )
3496
3496
{
3497
3497
Assert (!InProgressBuf );
3498
3498
@@ -3558,8 +3558,7 @@ StartBufferIO(volatile BufferDesc *buf, bool forInput)
3558
3558
* be 0, or BM_VALID if we just finished reading in the page.
3559
3559
*/
3560
3560
static void
3561
- TerminateBufferIO (volatile BufferDesc * buf , bool clear_dirty ,
3562
- int set_flag_bits )
3561
+ TerminateBufferIO (BufferDesc * buf , bool clear_dirty , int set_flag_bits )
3563
3562
{
3564
3563
Assert (buf == InProgressBuf );
3565
3564
@@ -3590,7 +3589,7 @@ TerminateBufferIO(volatile BufferDesc *buf, bool clear_dirty,
3590
3589
void
3591
3590
AbortBufferIO (void )
3592
3591
{
3593
- volatile BufferDesc * buf = InProgressBuf ;
3592
+ BufferDesc * buf = InProgressBuf ;
3594
3593
3595
3594
if (buf )
3596
3595
{
@@ -3643,7 +3642,7 @@ AbortBufferIO(void)
3643
3642
static void
3644
3643
shared_buffer_write_error_callback (void * arg )
3645
3644
{
3646
- volatile BufferDesc * bufHdr = (volatile BufferDesc * ) arg ;
3645
+ BufferDesc * bufHdr = (BufferDesc * ) arg ;
3647
3646
3648
3647
/* Buffer is pinned, so we can read the tag without locking the spinlock */
3649
3648
if (bufHdr != NULL )
@@ -3662,7 +3661,7 @@ shared_buffer_write_error_callback(void *arg)
3662
3661
static void
3663
3662
local_buffer_write_error_callback (void * arg )
3664
3663
{
3665
- volatile BufferDesc * bufHdr = (volatile BufferDesc * ) arg ;
3664
+ BufferDesc * bufHdr = (BufferDesc * ) arg ;
3666
3665
3667
3666
if (bufHdr != NULL )
3668
3667
{
0 commit comments