0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
This commit is contained in:
Dwight 2010-11-16 16:27:26 -05:00
parent 87be2c5e2a
commit f8cc8e608e
2 changed files with 6 additions and 14 deletions

View File

@ -111,25 +111,16 @@ namespace mongo {
bool MongoMMF::open(string fname, bool sequentialHint) {
setPath(fname);
_view_write = mapWithOptions(fname.c_str(), sequentialHint ? SEQUENTIAL : 0);
// temp : _view_private pending more work!
_view_private = _view_write;
if( _view_write ) {
if( durable ) {
privateViews.add(_view_private, this);
if( debug ) {
_view_readonly = MemoryMappedFile::createReadOnlyMap();
ourReadViews.add(_view_readonly, this);
}
}
return true;
}
return false;
return finishOpening();
}
bool MongoMMF::create(string fname, unsigned long long& len, bool sequentialHint) {
setPath(fname);
_view_write = map(fname.c_str(), len, sequentialHint ? SEQUENTIAL : 0);
// temp : _view_private pending more work! not implemented yet.
return finishOpening();
}
bool MongoMMF::finishOpening() {
_view_private = _view_write;
if( _view_write ) {
if( durable ) {

View File

@ -80,6 +80,7 @@ namespace mongo {
string _filePath;
int _fileSuffixNo;
void setPath(string fn);
bool finishOpening();
};
/** for durability support we want to be able to map pointers to specific MongoMMF objects.