aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/freelist.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2015-11-16 18:50:06 -0500
committerRobert Haas <rhaas@postgresql.org>2015-11-16 18:50:06 -0500
commite93b62985f9c69dcb6f0747450809fff64b78a6e (patch)
tree8a7f16d6735c2711544fa726ee2300d2b3a0fed9 /src/backend/storage/buffer/freelist.c
parent8004953b5a2449c26c4e082771276b2f8629d153 (diff)
downloadpostgresql-e93b62985f9c69dcb6f0747450809fff64b78a6e.tar.gz
postgresql-e93b62985f9c69dcb6f0747450809fff64b78a6e.zip
Remove volatile qualifiers from bufmgr.c and freelist.c
Prior to commit 0709b7ee72e4bc71ad07b7120acd117265ab51d0, access to variables within a spinlock-protected critical section had to be done through a volatile pointer, but that should no longer be necessary. Review by Andres Freund
Diffstat (limited to 'src/backend/storage/buffer/freelist.c')
-rw-r--r--src/backend/storage/buffer/freelist.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c
index bc2c7730003..023457282b0 100644
--- a/src/backend/storage/buffer/freelist.c
+++ b/src/backend/storage/buffer/freelist.c
@@ -98,9 +98,9 @@ typedef struct BufferAccessStrategyData
/* Prototypes for internal functions */
-static volatile BufferDesc *GetBufferFromRing(BufferAccessStrategy strategy);
+static BufferDesc *GetBufferFromRing(BufferAccessStrategy strategy);
static void AddBufferToRing(BufferAccessStrategy strategy,
- volatile BufferDesc *buf);
+ BufferDesc *buf);
/*
* ClockSweepTick - Helper routine for StrategyGetBuffer()
@@ -179,10 +179,10 @@ ClockSweepTick(void)
* To ensure that no one else can pin the buffer before we do, we must
* return the buffer with the buffer header spinlock still held.
*/
-volatile BufferDesc *
+BufferDesc *
StrategyGetBuffer(BufferAccessStrategy strategy)
{
- volatile BufferDesc *buf;
+ BufferDesc *buf;
int bgwprocno;
int trycounter;
@@ -338,7 +338,7 @@ StrategyGetBuffer(BufferAccessStrategy strategy)
* StrategyFreeBuffer: put a buffer on the freelist
*/
void
-StrategyFreeBuffer(volatile BufferDesc *buf)
+StrategyFreeBuffer(BufferDesc *buf)
{
SpinLockAcquire(&StrategyControl->buffer_strategy_lock);
@@ -584,10 +584,10 @@ FreeAccessStrategy(BufferAccessStrategy strategy)
*
* The bufhdr spin lock is held on the returned buffer.
*/
-static volatile BufferDesc *
+static BufferDesc *
GetBufferFromRing(BufferAccessStrategy strategy)
{
- volatile BufferDesc *buf;
+ BufferDesc *buf;
Buffer bufnum;
/* Advance to next ring slot */
@@ -639,7 +639,7 @@ GetBufferFromRing(BufferAccessStrategy strategy)
* is called with the spinlock held, it had better be quite cheap.
*/
static void
-AddBufferToRing(BufferAccessStrategy strategy, volatile BufferDesc *buf)
+AddBufferToRing(BufferAccessStrategy strategy, BufferDesc *buf)
{
strategy->buffers[strategy->current] = BufferDescriptorGetBuffer(buf);
}
@@ -656,7 +656,7 @@ AddBufferToRing(BufferAccessStrategy strategy, volatile BufferDesc *buf)
* if this buffer should be written and re-used.
*/
bool
-StrategyRejectBuffer(BufferAccessStrategy strategy, volatile BufferDesc *buf)
+StrategyRejectBuffer(BufferAccessStrategy strategy, BufferDesc *buf)
{
/* We only do this in bulkread mode */
if (strategy->btype != BAS_BULKREAD)