Removed handling/warning related to old kludge.

This commit is contained in:
Sears Russell 2008-10-04 07:27:53 +00:00
parent a20d28d369
commit a6a83b98a1

View file

@ -12,8 +12,6 @@ int stasis_fixed_records_per_page(size_t size) {
/** @todo CORRECTNESS Locking for stasis_fixed_initialize_page? (should hold writelock)*/ /** @todo CORRECTNESS Locking for stasis_fixed_initialize_page? (should hold writelock)*/
void stasis_fixed_initialize_page(Page * page, size_t size, int count) { void stasis_fixed_initialize_page(Page * page, size_t size, int count) {
assertlocked(page->rwlatch); assertlocked(page->rwlatch);
// XXX fixed page asserts it's been given an UNINITIALIZED_PAGE... Why doesn't that crash?
// assert(*stasis_page_type_ptr(page) == UNINITIALIZED_PAGE);
stasis_page_cleanup(page); stasis_page_cleanup(page);
*stasis_page_type_ptr(page) = FIXED_PAGE; *stasis_page_type_ptr(page) = FIXED_PAGE;
*recordsize_ptr(page) = size; *recordsize_ptr(page) = size;
@ -21,19 +19,10 @@ void stasis_fixed_initialize_page(Page * page, size_t size, int count) {
*recordcount_ptr(page)= count; *recordcount_ptr(page)= count;
} }
static int checkRidWarnedAboutUninitializedKludge = 0;
static void checkRid(Page * page, recordid rid) { static void checkRid(Page * page, recordid rid) {
assertlocked(page->rwlatch); assertlocked(page->rwlatch);
if(! *stasis_page_type_ptr(page)) { assert(*stasis_page_type_ptr(page) == FIXED_PAGE ||
if(!checkRidWarnedAboutUninitializedKludge) { *stasis_page_type_ptr(page) == ARRAY_LIST_PAGE);
checkRidWarnedAboutUninitializedKludge = 1;
printf("KLUDGE detected in checkRid. Fix it ASAP\n");
fflush(stdout);
abort();
}
stasis_fixed_initialize_page(page, rid.size, stasis_fixed_records_per_page(rid.size));
}
assert(page->id == rid.page); assert(page->id == rid.page);
assert(*recordsize_ptr(page) == rid.size); assert(*recordsize_ptr(page) == rid.size);
assert(stasis_fixed_records_per_page(rid.size) > rid.slot); assert(stasis_fixed_records_per_page(rid.size) > rid.slot);