summaryrefslogtreecommitdiff
path: root/db/pdfile.cpp
diff options
context:
space:
mode:
authorDwight <dwight@10gen.com>2010-09-28 18:08:44 -0400
committerDwight <dwight@10gen.com>2010-09-28 18:08:44 -0400
commita0e977c8c1b86346c0d570beb806417a298cf528 (patch)
treeb607f450c6b1b033ea7105684ec39ce8761f6dfa /db/pdfile.cpp
parente414e72d5a629cef1a5f73d1c1999107bf2a65cc (diff)
downloadmongo-a0e977c8c1b86346c0d570beb806417a298cf528.tar.gz
write intent
Diffstat (limited to 'db/pdfile.cpp')
-rw-r--r--db/pdfile.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/db/pdfile.cpp b/db/pdfile.cpp
index 830715210f3..5462dc740bc 100644
--- a/db/pdfile.cpp
+++ b/db/pdfile.cpp
@@ -1670,15 +1670,24 @@ namespace mongo {
Extent *e = r->myExtent(loc);
if ( e->lastRecord.isNull() ) {
- e->firstRecord = e->lastRecord = loc;
- r->prevOfs = r->nextOfs = DiskLoc::NullOfs;
+ {
+ DiskLoc *ptr = &e->firstRecord;
+ ptr = (DiskLoc *) dur::writingPtr(ptr, sizeof(DiskLoc)*2);
+ //e->firstRecord = e->lastRecord = loc;
+ ptr[0] = ptr[1] = loc;
+ }
+ {
+ int *ip = (int*) dur::writingPtr(&r->nextOfs, 8);
+ //r->prevOfs = r->nextOfs = DiskLoc::NullOfs;
+ ip[0] = ip[1] = DiskLoc::NullOfs;
+ }
}
else {
Record *oldlast = e->lastRecord.rec();
r->prevOfs = e->lastRecord.getOfs();
r->nextOfs = DiskLoc::NullOfs;
oldlast->nextOfs = loc.getOfs();
- e->lastRecord = loc;
+ e->lastRecord.writing() = loc;
}
/* todo: don't update for oplog? seems wasteful. */