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

Function BufferMProtect

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

Source from the content-addressed store, hash-verified

515 !BufferIsInvalid(buf->buf_id+1))
516
517static inline void BufferMProtect(volatile BufferDesc *bufHdr, int protectionLevel)
518{
519 if (ShouldMemoryProtect(bufHdr))
520 {
521 if (mprotect(BufHdrGetBlock(bufHdr), BLCKSZ, protectionLevel))
522 {
523 ereport(ERROR,
524 (errmsg("unable to set memory level to %d, error %d, "
525 "block size %d, ptr %ld", protectionLevel,
526 errno, BLCKSZ, (long int) BufHdrGetBlock(bufHdr))));
527 }
528 }
529}
530#endif
531
532static inline void ReleaseContentLock(volatile BufferDesc *buf)

Callers 9

ReleaseContentLockFunction · 0.85
AcquireContentLockFunction · 0.85
ReadBuffer_commonFunction · 0.85
PinBufferFunction · 0.85
PinBuffer_LockedFunction · 0.85
UnpinBufferFunction · 0.85
StartBufferIOFunction · 0.85
TerminateBufferIOFunction · 0.85

Calls 1

errmsgFunction · 0.50

Tested by

no test coverage detected