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));
|
int * tmpOffset = (int *)(metaPages[tid].mapped + (i * 8));
|
||||||
if ((tmpOffset[0] == 0 && tmpOffset[1] == 0)) {
|
if ((tmpOffset[0] == 0 && tmpOffset[1] == 0)) {
|
||||||
tmpOffset[0] = htonl(curPageNum[tid]);
|
tmpOffset[0] = htonl(curPageNum[tid]);
|
||||||
if (pagesByTrack[tid][pageNumber].dataSize == DEFAULT_DATA_PAGE_SIZE){
|
tmpOffset[1] = htonl(1000);
|
||||||
tmpOffset[1] = htonl(1000);
|
|
||||||
} else {
|
|
||||||
tmpOffset[1] = htonl(pagesByTrack[tid][pageNumber].keyNum);
|
|
||||||
}
|
|
||||||
inserted = true;
|
inserted = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!inserted){
|
||||||
|
FAIL_MSG("Could not insert page in track index. Aborting.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///\return true if everything was successful
|
///\return true if everything was successful
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue