PostgreSQL Source Code  git master
resowner_private.h File Reference
#include "storage/dsm.h"
#include "storage/fd.h"
#include "storage/lock.h"
#include "utils/catcache.h"
#include "utils/plancache.h"
#include "utils/resowner.h"
#include "utils/snapshot.h"
Include dependency graph for resowner_private.h:

Go to the source code of this file.

Functions

void ResourceOwnerEnlargeBuffers (ResourceOwner owner)
 
void ResourceOwnerRememberBuffer (ResourceOwner owner, Buffer buffer)
 
void ResourceOwnerForgetBuffer (ResourceOwner owner, Buffer buffer)
 
void ResourceOwnerEnlargeBufferIOs (ResourceOwner owner)
 
void ResourceOwnerRememberBufferIO (ResourceOwner owner, Buffer buffer)
 
void ResourceOwnerForgetBufferIO (ResourceOwner owner, Buffer buffer)
 
void ResourceOwnerRememberLock (ResourceOwner owner, LOCALLOCK *locallock)
 
void ResourceOwnerForgetLock (ResourceOwner owner, LOCALLOCK *locallock)
 
void ResourceOwnerEnlargeCatCacheRefs (ResourceOwner owner)
 
void ResourceOwnerRememberCatCacheRef (ResourceOwner owner, HeapTuple tuple)
 
void ResourceOwnerForgetCatCacheRef (ResourceOwner owner, HeapTuple tuple)
 
void ResourceOwnerEnlargeCatCacheListRefs (ResourceOwner owner)
 
void ResourceOwnerRememberCatCacheListRef (ResourceOwner owner, CatCList *list)
 
void ResourceOwnerForgetCatCacheListRef (ResourceOwner owner, CatCList *list)
 
void ResourceOwnerEnlargeRelationRefs (ResourceOwner owner)
 
void ResourceOwnerRememberRelationRef (ResourceOwner owner, Relation rel)
 
void ResourceOwnerForgetRelationRef (ResourceOwner owner, Relation rel)
 
void ResourceOwnerEnlargePlanCacheRefs (ResourceOwner owner)
 
void ResourceOwnerRememberPlanCacheRef (ResourceOwner owner, CachedPlan *plan)
 
void ResourceOwnerForgetPlanCacheRef (ResourceOwner owner, CachedPlan *plan)
 
void ResourceOwnerEnlargeTupleDescs (ResourceOwner owner)
 
void ResourceOwnerRememberTupleDesc (ResourceOwner owner, TupleDesc tupdesc)
 
void ResourceOwnerForgetTupleDesc (ResourceOwner owner, TupleDesc tupdesc)
 
void ResourceOwnerEnlargeSnapshots (ResourceOwner owner)
 
void ResourceOwnerRememberSnapshot (ResourceOwner owner, Snapshot snapshot)
 
void ResourceOwnerForgetSnapshot (ResourceOwner owner, Snapshot snapshot)
 
void ResourceOwnerEnlargeFiles (ResourceOwner owner)
 
void ResourceOwnerRememberFile (ResourceOwner owner, File file)
 
void ResourceOwnerForgetFile (ResourceOwner owner, File file)
 
void ResourceOwnerEnlargeDSMs (ResourceOwner owner)
 
void ResourceOwnerRememberDSM (ResourceOwner owner, dsm_segment *)
 
void ResourceOwnerForgetDSM (ResourceOwner owner, dsm_segment *)
 
void ResourceOwnerEnlargeJIT (ResourceOwner owner)
 
void ResourceOwnerRememberJIT (ResourceOwner owner, Datum handle)
 
void ResourceOwnerForgetJIT (ResourceOwner owner, Datum handle)
 
void ResourceOwnerEnlargeCryptoHash (ResourceOwner owner)
 
void ResourceOwnerRememberCryptoHash (ResourceOwner owner, Datum handle)
 
void ResourceOwnerForgetCryptoHash (ResourceOwner owner, Datum handle)
 
void ResourceOwnerEnlargeHMAC (ResourceOwner owner)
 
void ResourceOwnerRememberHMAC (ResourceOwner owner, Datum handle)
 
void ResourceOwnerForgetHMAC (ResourceOwner owner, Datum handle)
 

Function Documentation

◆ ResourceOwnerEnlargeBufferIOs()

void ResourceOwnerEnlargeBufferIOs ( ResourceOwner  owner)

◆ ResourceOwnerEnlargeBuffers()

void ResourceOwnerEnlargeBuffers ( ResourceOwner  owner)

◆ ResourceOwnerEnlargeCatCacheListRefs()

void ResourceOwnerEnlargeCatCacheListRefs ( ResourceOwner  owner)

◆ ResourceOwnerEnlargeCatCacheRefs()

void ResourceOwnerEnlargeCatCacheRefs ( ResourceOwner  owner)

◆ ResourceOwnerEnlargeCryptoHash()

void ResourceOwnerEnlargeCryptoHash ( ResourceOwner  owner)

◆ ResourceOwnerEnlargeDSMs()

void ResourceOwnerEnlargeDSMs ( ResourceOwner  owner)

◆ ResourceOwnerEnlargeFiles()

void ResourceOwnerEnlargeFiles ( ResourceOwner  owner)

◆ ResourceOwnerEnlargeHMAC()

void ResourceOwnerEnlargeHMAC ( ResourceOwner  owner)

◆ ResourceOwnerEnlargeJIT()

void ResourceOwnerEnlargeJIT ( ResourceOwner  owner)

◆ ResourceOwnerEnlargePlanCacheRefs()

void ResourceOwnerEnlargePlanCacheRefs ( ResourceOwner  owner)

◆ ResourceOwnerEnlargeRelationRefs()

void ResourceOwnerEnlargeRelationRefs ( ResourceOwner  owner)

◆ ResourceOwnerEnlargeSnapshots()

void ResourceOwnerEnlargeSnapshots ( ResourceOwner  owner)

◆ ResourceOwnerEnlargeTupleDescs()

void ResourceOwnerEnlargeTupleDescs ( ResourceOwner  owner)

◆ ResourceOwnerForgetBuffer()

void ResourceOwnerForgetBuffer ( ResourceOwner  owner,
Buffer  buffer 
)

Referenced by UnpinBuffer(), and UnpinLocalBuffer().

◆ ResourceOwnerForgetBufferIO()

void ResourceOwnerForgetBufferIO ( ResourceOwner  owner,
Buffer  buffer 
)

Referenced by TerminateBufferIO().

◆ ResourceOwnerForgetCatCacheListRef()

void ResourceOwnerForgetCatCacheListRef ( ResourceOwner  owner,
CatCList list 
)

◆ ResourceOwnerForgetCatCacheRef()

void ResourceOwnerForgetCatCacheRef ( ResourceOwner  owner,
HeapTuple  tuple 
)

◆ ResourceOwnerForgetCryptoHash()

void ResourceOwnerForgetCryptoHash ( ResourceOwner  owner,
Datum  handle 
)

◆ ResourceOwnerForgetDSM()

void ResourceOwnerForgetDSM ( ResourceOwner  owner,
dsm_segment  
)

◆ ResourceOwnerForgetFile()

void ResourceOwnerForgetFile ( ResourceOwner  owner,
File  file 
)

◆ ResourceOwnerForgetHMAC()

void ResourceOwnerForgetHMAC ( ResourceOwner  owner,
Datum  handle 
)

◆ ResourceOwnerForgetJIT()

void ResourceOwnerForgetJIT ( ResourceOwner  owner,
Datum  handle 
)

◆ ResourceOwnerForgetLock()

void ResourceOwnerForgetLock ( ResourceOwner  owner,
LOCALLOCK locallock 
)

Definition at line 1065 of file resowner.c.

1066 {
1067  int i;
1068 
1069  if (owner->nlocks > MAX_RESOWNER_LOCKS)
1070  return; /* we have overflowed */
1071 
1072  Assert(owner->nlocks > 0);
1073  for (i = owner->nlocks - 1; i >= 0; i--)
1074  {
1075  if (locallock == owner->locks[i])
1076  {
1077  owner->locks[i] = owner->locks[owner->nlocks - 1];
1078  owner->nlocks--;
1079  return;
1080  }
1081  }
1082  elog(ERROR, "lock reference %p is not owned by resource owner %s",
1083  locallock, owner->name);
1084 }
#define ERROR
Definition: elog.h:39
#define elog(elevel,...)
Definition: elog.h:224
int i
Definition: isn.c:73
Assert(fmt[strlen(fmt) - 1] !='\n')
#define MAX_RESOWNER_LOCKS
Definition: resowner.c:105
const char * name
Definition: resowner.c:115
LOCALLOCK * locks[MAX_RESOWNER_LOCKS]
Definition: resowner.c:157

References Assert(), elog, ERROR, i, ResourceOwnerData::locks, MAX_RESOWNER_LOCKS, ResourceOwnerData::name, and ResourceOwnerData::nlocks.

Referenced by LockReassignOwner(), LockRelease(), LockReleaseAll(), ReleaseLockIfHeld(), and RemoveLocalLock().

◆ ResourceOwnerForgetPlanCacheRef()

void ResourceOwnerForgetPlanCacheRef ( ResourceOwner  owner,
CachedPlan plan 
)

◆ ResourceOwnerForgetRelationRef()

void ResourceOwnerForgetRelationRef ( ResourceOwner  owner,
Relation  rel 
)

◆ ResourceOwnerForgetSnapshot()

void ResourceOwnerForgetSnapshot ( ResourceOwner  owner,
Snapshot  snapshot 
)

◆ ResourceOwnerForgetTupleDesc()

void ResourceOwnerForgetTupleDesc ( ResourceOwner  owner,
TupleDesc  tupdesc 
)

◆ ResourceOwnerRememberBuffer()

void ResourceOwnerRememberBuffer ( ResourceOwner  owner,
Buffer  buffer 
)

◆ ResourceOwnerRememberBufferIO()

void ResourceOwnerRememberBufferIO ( ResourceOwner  owner,
Buffer  buffer 
)

Referenced by StartBufferIO().

◆ ResourceOwnerRememberCatCacheListRef()

void ResourceOwnerRememberCatCacheListRef ( ResourceOwner  owner,
CatCList list 
)

◆ ResourceOwnerRememberCatCacheRef()

void ResourceOwnerRememberCatCacheRef ( ResourceOwner  owner,
HeapTuple  tuple 
)

◆ ResourceOwnerRememberCryptoHash()

void ResourceOwnerRememberCryptoHash ( ResourceOwner  owner,
Datum  handle 
)

◆ ResourceOwnerRememberDSM()

void ResourceOwnerRememberDSM ( ResourceOwner  owner,
dsm_segment  
)

◆ ResourceOwnerRememberFile()

void ResourceOwnerRememberFile ( ResourceOwner  owner,
File  file 
)

◆ ResourceOwnerRememberHMAC()

void ResourceOwnerRememberHMAC ( ResourceOwner  owner,
Datum  handle 
)

◆ ResourceOwnerRememberJIT()

void ResourceOwnerRememberJIT ( ResourceOwner  owner,
Datum  handle 
)

◆ ResourceOwnerRememberLock()

void ResourceOwnerRememberLock ( ResourceOwner  owner,
LOCALLOCK locallock 
)

Definition at line 1045 of file resowner.c.

1046 {
1047  Assert(locallock != NULL);
1048 
1049  if (owner->nlocks > MAX_RESOWNER_LOCKS)
1050  return; /* we have already overflowed */
1051 
1052  if (owner->nlocks < MAX_RESOWNER_LOCKS)
1053  owner->locks[owner->nlocks] = locallock;
1054  else
1055  {
1056  /* overflowed */
1057  }
1058  owner->nlocks++;
1059 }

References Assert(), ResourceOwnerData::locks, MAX_RESOWNER_LOCKS, and ResourceOwnerData::nlocks.

Referenced by GrantLockLocal(), and LockReassignOwner().

◆ ResourceOwnerRememberPlanCacheRef()

void ResourceOwnerRememberPlanCacheRef ( ResourceOwner  owner,
CachedPlan plan 
)

◆ ResourceOwnerRememberRelationRef()

void ResourceOwnerRememberRelationRef ( ResourceOwner  owner,
Relation  rel 
)

◆ ResourceOwnerRememberSnapshot()

void ResourceOwnerRememberSnapshot ( ResourceOwner  owner,
Snapshot  snapshot 
)

◆ ResourceOwnerRememberTupleDesc()

void ResourceOwnerRememberTupleDesc ( ResourceOwner  owner,
TupleDesc  tupdesc 
)