Added track index add checking for live data pages.
This commit is contained in:
parent
aa2dd8491c
commit
f26ec4c6d8
1 changed files with 5 additions and 6 deletions
11
src/io.cpp
11
src/io.cpp
|
@ -158,18 +158,17 @@ namespace Mist {
|
|||
int * tmpOffset = (int *)(metaPages[tid].mapped + (i * 8));
|
||||
if ((tmpOffset[0] == 0 && tmpOffset[1] == 0)) {
|
||||
tmpOffset[0] = htonl(curPageNum[tid]);
|
||||
if (pagesByTrack[tid][pageNumber].dataSize == DEFAULT_DATA_PAGE_SIZE){
|
||||
tmpOffset[1] = htonl(1000);
|
||||
} else {
|
||||
tmpOffset[1] = htonl(pagesByTrack[tid][pageNumber].keyNum);
|
||||
}
|
||||
tmpOffset[1] = htonl(1000);
|
||||
inserted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!inserted){
|
||||
FAIL_MSG("Could not insert page in track index. Aborting.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///\return true if everything was successful
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue