stasis-aries-wal/src/lladd/page/raw.c

42 lines
903 B
C
Raw Normal View History

#include "page/raw.h"
#include <lladd/logger/logger2.h>
2006-04-14 03:45:26 +00:00
#include <lladd/truncation.h>
/**
@todo Should rawPageInferMetadata set a page type in the Page
struct?
*/
void rawPageInferMetadata(Page * p) {
p->LSN = LogFlushedLSN();
}
byte* rawPageGetData(int xid, Page * p) {
return units_from_start_raw(byte, p, 0);
}
void rawPageSetData(int xid, lsn_t lsn, Page * p) {
writelock(p->rwlatch, 255);
rawPageWriteLSN(xid, p, lsn);
2006-04-14 03:45:26 +00:00
dirtyPages_add(p);
unlock(p->rwlatch);
return;
}
lsn_t rawPageReadLSN(const Page * p) {
// There are some potential optimizations here since the page
// doesn't "really" have an LSN at all, but we need to be careful
// about log truncation...
return p->LSN;
}
void rawPageWriteLSN(int xid, Page * p, lsn_t lsn) {
if(p->LSN < lsn) { p->LSN = lsn; }
}
void rawPageCommit(int xid) {
// no-op
}
void rawPageAbort(int xid) {
// no-op
}