mirror of https://github.com/citusdata/citus.git
Change prototype of GetShardSplitInfoSMHeaderFromDSMHandle
parent
59c3c93aa4
commit
121ec8cd51
|
@ -28,10 +28,7 @@ static ShardSplitInfoSMHeader * AllocateSharedMemoryForShardSplitInfo(int
|
||||||
|
|
||||||
static void * ShardSplitInfoSMSteps(ShardSplitInfoSMHeader *shardSplitInfoSMHeader);
|
static void * ShardSplitInfoSMSteps(ShardSplitInfoSMHeader *shardSplitInfoSMHeader);
|
||||||
|
|
||||||
static ShardSplitInfoSMHeader * GetShardSplitInfoSMHeaderFromDSMHandle(dsm_handle
|
static ShardSplitInfoSMHeader * GetShardSplitInfoSMHeaderFromDSMHandle(dsm_handle dsmHandle);
|
||||||
dsmHandle,
|
|
||||||
dsm_segment **
|
|
||||||
attachedSegment);
|
|
||||||
static dsm_handle GetSMHandleFromSlotName(char *slotName);
|
static dsm_handle GetSMHandleFromSlotName(char *slotName);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -40,8 +37,7 @@ static dsm_handle GetSMHandleFromSlotName(char *slotName);
|
||||||
* lifetime of the backend process accessing it.
|
* lifetime of the backend process accessing it.
|
||||||
*/
|
*/
|
||||||
static ShardSplitInfoSMHeader *
|
static ShardSplitInfoSMHeader *
|
||||||
GetShardSplitInfoSMHeaderFromDSMHandle(dsm_handle dsmHandle,
|
GetShardSplitInfoSMHeaderFromDSMHandle(dsm_handle dsmHandle)
|
||||||
dsm_segment **attachedSegment)
|
|
||||||
{
|
{
|
||||||
dsm_segment *dsmSegment = dsm_find_mapping(dsmHandle);
|
dsm_segment *dsmSegment = dsm_find_mapping(dsmHandle);
|
||||||
|
|
||||||
|
@ -63,8 +59,6 @@ GetShardSplitInfoSMHeaderFromDSMHandle(dsm_handle dsmHandle,
|
||||||
ShardSplitInfoSMHeader *header = (ShardSplitInfoSMHeader *) dsm_segment_address(
|
ShardSplitInfoSMHeader *header = (ShardSplitInfoSMHeader *) dsm_segment_address(
|
||||||
dsmSegment);
|
dsmSegment);
|
||||||
|
|
||||||
*attachedSegment = dsmSegment;
|
|
||||||
|
|
||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,10 +79,8 @@ GetShardSplitInfoSMArrayForSlot(char *slotName, int *arraySize)
|
||||||
}
|
}
|
||||||
|
|
||||||
dsm_handle dsmHandle = GetSMHandleFromSlotName(slotName);
|
dsm_handle dsmHandle = GetSMHandleFromSlotName(slotName);
|
||||||
dsm_segment *dsmSegment = NULL;
|
|
||||||
ShardSplitInfoSMHeader *shardSplitInfoSMHeader =
|
ShardSplitInfoSMHeader *shardSplitInfoSMHeader =
|
||||||
GetShardSplitInfoSMHeaderFromDSMHandle(dsmHandle,
|
GetShardSplitInfoSMHeaderFromDSMHandle(dsmHandle);
|
||||||
&dsmSegment);
|
|
||||||
*arraySize = shardSplitInfoSMHeader->stepCount;
|
*arraySize = shardSplitInfoSMHeader->stepCount;
|
||||||
|
|
||||||
ShardSplitInfo *shardSplitInfoArray =
|
ShardSplitInfo *shardSplitInfoArray =
|
||||||
|
@ -162,7 +154,7 @@ AllocateSharedMemoryForShardSplitInfo(int shardSplitInfoCount, Size shardSplitIn
|
||||||
dsm_pin_segment(dsmSegment);
|
dsm_pin_segment(dsmSegment);
|
||||||
|
|
||||||
ShardSplitInfoSMHeader *shardSplitInfoSMHeader =
|
ShardSplitInfoSMHeader *shardSplitInfoSMHeader =
|
||||||
GetShardSplitInfoSMHeaderFromDSMHandle(*dsmHandle, &dsmSegment);
|
GetShardSplitInfoSMHeaderFromDSMHandle(*dsmHandle);
|
||||||
|
|
||||||
shardSplitInfoSMHeader->stepCount = shardSplitInfoCount;
|
shardSplitInfoSMHeader->stepCount = shardSplitInfoCount;
|
||||||
shardSplitInfoSMHeader->processId = MyProcPid;
|
shardSplitInfoSMHeader->processId = MyProcPid;
|
||||||
|
@ -173,7 +165,7 @@ AllocateSharedMemoryForShardSplitInfo(int shardSplitInfoCount, Size shardSplitIn
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CreateSharedMemoryForShardSplitInfo is a wrapper function which creates shared memory
|
* CreateSharedMemoryForShardSplitInfo is a wrapper function which creates shared memory
|
||||||
* for storing shard split infomation. The function returns pointer the first element
|
* for storing shard split infomation. The function returns pointer to the first element
|
||||||
* within this array.
|
* within this array.
|
||||||
*
|
*
|
||||||
* shardSplitInfoCount - number of 'ShardSplitInfo ' elements to be allocated
|
* shardSplitInfoCount - number of 'ShardSplitInfo ' elements to be allocated
|
||||||
|
|
Loading…
Reference in New Issue