MCPcopy Create free account
hub / github.com/apache/cloudberry / BufferGetBlockNumber

Function BufferGetBlockNumber

src/backend/storage/buffer/bufmgr.c:2912–2926  ·  view source on GitHub ↗

* BufferGetBlockNumber * Returns the block number associated with a buffer. * * Note: * Assumes that the buffer is valid and pinned, else the * value may be obsolete immediately... */

Source from the content-addressed store, hash-verified

2910 * value may be obsolete immediately...
2911 */
2912BlockNumber
2913BufferGetBlockNumber(Buffer buffer)
2914{
2915 BufferDesc *bufHdr;
2916
2917 Assert(BufferIsPinned(buffer));
2918
2919 if (BufferIsLocal(buffer))
2920 bufHdr = GetLocalBufferDescriptor(-buffer - 1);
2921 else
2922 bufHdr = GetBufferDescriptor(buffer - 1);
2923
2924 /* pinned, so OK to read tag without spinlock */
2925 return bufHdr->tag.blockNum;
2926}
2927
2928/*
2929 * BufferGetTag

Callers 15

pgstathashindexFunction · 0.85
BloomInitMetapageFunction · 0.85
blinsertFunction · 0.85
fill_seq_with_dataFunction · 0.85
allocNewBufferFunction · 0.85
SpGistSetLastUsedPageFunction · 0.85
moveLeafsFunction · 0.85
doPickSplitFunction · 0.85
spgAddNodeActionFunction · 0.85
spgSplitNodeActionFunction · 0.85
spgdoinsertFunction · 0.85
spgbuildFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected