Skip to content

Commit 089ae3b

Browse files
committed
Properly access a buffer's LSN using existing access macros instead of abusing
knowledge of page layout. Stolen from Jonah Harris' CRC patch
1 parent 97227e9 commit 089ae3b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/storage/buffer/bufmgr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.238 2008/09/17 13:15:55 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.239 2008/10/20 21:11:15 alvherre Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -48,7 +48,7 @@
4848

4949
/* Note: these two macros only work on shared buffers, not local ones! */
5050
#define BufHdrGetBlock(bufHdr) ((Block) (BufferBlocks + ((Size) (bufHdr)->buf_id) * BLCKSZ))
51-
#define BufferGetLSN(bufHdr) (*((XLogRecPtr*) BufHdrGetBlock(bufHdr)))
51+
#define BufferGetLSN(bufHdr) (PageGetLSN(BufHdrGetBlock(bufHdr)))
5252

5353
/* Note: this macro only works on local buffers, not shared ones! */
5454
#define LocalBufHdrGetBlock(bufHdr) \

0 commit comments

Comments
 (0)