From e93b62985f9c69dcb6f0747450809fff64b78a6e Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Mon, 16 Nov 2015 18:50:06 -0500 Subject: 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 --- src/backend/storage/buffer/freelist.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/backend/storage/buffer/freelist.c') 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) -- cgit v1.2.3