mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
DRY
This commit is contained in:
parent
87be2c5e2a
commit
f8cc8e608e
@ -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 ) {
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user