void stasis_page_flushed(Page * p){ pagetype_t type = p->pageType; assert(page_impls[type].page_type == type); if(page_impls[type].has_header) { *stasis_page_type_ptr(p)= type; *stasis_page_lsn_ptr(p) = p->LSN; } else { *stasis_page_type_ptr(p)= type; // XXX 'has_header' is a misnomer. } if(page_impls[type].pageFlushed) page_impls[type].pageFlushed(p); }
void stasis_uninitialized_page_loaded(int xid, Page * p) { /// XXX this should be pushed into the pageLoaded callback, but the // callback would need the xid, and currently is not given the xid. lsn_t xid_lsn; if(xid == INVALID_XID) { xid_lsn = INVALID_LSN; } else { xid_lsn = stasis_transaction_table_get((stasis_transaction_table_t*)stasis_runtime_transaction_table(), xid)->prevLSN; } lsn_t log_lsn = ((stasis_log_t*)stasis_log())->next_available_lsn((stasis_log_t*)stasis_log()); // If this transaction has a prevLSN, prefer it. Otherwise, set the LSN to nextAvailableLSN - 1 p->LSN = *stasis_page_lsn_ptr(p) = (xid_lsn == INVALID_LSN) ? (log_lsn - 1) : xid_lsn; p->pageType = *stasis_page_type_ptr(p) = UNINITIALIZED_PAGE; if (page_impls[p->pageType].pageLoaded) page_impls[p->pageType].pageLoaded(p); }
static void stasis_page_blob_flushed(Page *p) { *stasis_page_lsn_ptr(p) = p->LSN; DEBUG("flush lsn: %lld\n", (long long)p->LSN); }
static void dataPageFlushed(Page* p) { *stasis_page_lsn_ptr(p) = p->LSN; dataPageFsck(p); }
static void stasis_page_blob_loaded(Page *p) { p->LSN = *stasis_page_lsn_ptr(p); DEBUG("load lsn: %lld\n", (long long)p->LSN); }