Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3c9a086

Browse files
committed
Fix pg_buffercache work with new BufferDesc.
1 parentfc7a1f6 commit3c9a086

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎contrib/pg_buffercache/pg_buffercache_pages.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,27 +149,28 @@ pg_buffercache_pages(PG_FUNCTION_ARGS)
149149
for (i=0;i<NBuffers;i++)
150150
{
151151
volatileBufferDesc*bufHdr;
152+
uint32state;
152153

153154
bufHdr=GetBufferDescriptor(i);
154155
/* Lock each buffer header before inspecting. */
155-
LockBufHdr(bufHdr);
156+
state=LockBufHdr(bufHdr);
156157

157158
fctx->record[i].bufferid=BufferDescriptorGetBuffer(bufHdr);
158159
fctx->record[i].relfilenode=bufHdr->tag.rnode.relNode;
159160
fctx->record[i].reltablespace=bufHdr->tag.rnode.spcNode;
160161
fctx->record[i].reldatabase=bufHdr->tag.rnode.dbNode;
161162
fctx->record[i].forknum=bufHdr->tag.forkNum;
162163
fctx->record[i].blocknum=bufHdr->tag.blockNum;
163-
fctx->record[i].usagecount=bufHdr->usage_count;
164-
fctx->record[i].pinning_backends=bufHdr->refcount;
164+
fctx->record[i].usagecount=BUF_STATE_GET_USAGECOUNT(state);
165+
fctx->record[i].pinning_backends=BUF_STATE_GET_REFCOUNT(state);
165166

166-
if (bufHdr->flags&BM_DIRTY)
167+
if (state&BM_DIRTY)
167168
fctx->record[i].isdirty= true;
168169
else
169170
fctx->record[i].isdirty= false;
170171

171172
/* Note if the buffer is valid, and has storage created */
172-
if ((bufHdr->flags&BM_VALID)&& (bufHdr->flags&BM_TAG_VALID))
173+
if ((state&BM_VALID)&& (state&BM_TAG_VALID))
173174
fctx->record[i].isvalid= true;
174175
else
175176
fctx->record[i].isvalid= false;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp