Skip to content

Commit

Permalink
NamspaceId is tied to PCD Namespace slot logical index
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Plucinski <[email protected]>
  • Loading branch information
mplucins authored and gldiviney committed Oct 24, 2018
1 parent fe5d0f5 commit f28a8f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions DcpmPkg/driver/Core/Namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,12 @@ GenerateNamespaceId(

LIST_FOR_EACH(pNode, &gNvmDimmData->PMEMDev.Namespaces) {
pNamespace = NAMESPACE_FROM_NODE(pNode, NamespaceNode);
if (pNamespace->NamespaceId > NamespaceId) {
if (pNamespace->NamespaceId == NamespaceId + 1) {
NamespaceId = pNamespace->NamespaceId;
}
else if (pNamespace->NamespaceId > NamespaceId) {
break;
}
}
NamespaceId++;
return NamespaceId;
Expand Down Expand Up @@ -1970,7 +1973,7 @@ RetrieveNamespacesFromLsa(

pNamespace->Flags.AsUint32 = pNamespaceLabel->Flags.AsUint32;
pNamespace->Signature = NAMESPACE_SIGNATURE;
pNamespace->NamespaceId = GenerateNamespaceId();
pNamespace->NamespaceId = (UINT16) Index;
pNamespace->Enabled = FALSE;
pNamespace->HealthState = NAMESPACE_HEALTH_OK;
CopyMem_S(&pNamespace->Name, sizeof(pNamespace->Name), &pNamespaceLabel->Name, NSLABEL_NAME_LEN);
Expand Down
2 changes: 1 addition & 1 deletion src/os/eventlog/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ static char* fgetsrev(char* str, int num, FILE * stream)
rc = fgets(str, num, stream);
if (NULL == rc)
return rc;
// Stor information about reached begin of file
// Store information about reached begin of file
if (pos == 0)
{
b_o_f = TRUE;
Expand Down

0 comments on commit f28a8f7

Please sign in to comment.