diff options
Diffstat (limited to 'src/mongo/dbtests/mmaptests.cpp')
-rw-r--r-- | src/mongo/dbtests/mmaptests.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/mongo/dbtests/mmaptests.cpp b/src/mongo/dbtests/mmaptests.cpp index ab6766b72c3..b0afc3e916f 100644 --- a/src/mongo/dbtests/mmaptests.cpp +++ b/src/mongo/dbtests/mmaptests.cpp @@ -77,16 +77,16 @@ public: MMAPV1LockerImpl lockState; Lock::GlobalWrite lk(&lockState); - auto txn = cc().makeOperationContext(); + auto opCtx = cc().makeOperationContext(); { - DurableMappedFile f(txn.get()); - ON_BLOCK_EXIT([&f, &txn] { - LockMongoFilesExclusive lock(txn.get()); - f.close(txn.get()); + DurableMappedFile f(opCtx.get()); + ON_BLOCK_EXIT([&f, &opCtx] { + LockMongoFilesExclusive lock(opCtx.get()); + f.close(opCtx.get()); }); unsigned long long len = 256 * 1024 * 1024; - verify(f.create(txn.get(), fn, len)); + verify(f.create(opCtx.get(), fn, len)); { char* p = (char*)f.getView(); verify(p); @@ -99,12 +99,12 @@ public: char* w = (char*)f.view_write(); strcpy(w + 6, "world"); } - MongoFileFinder ff(txn.get()); + MongoFileFinder ff(opCtx.get()); ASSERT(ff.findByPath(fn)); ASSERT(ff.findByPath("asdf") == 0); } { - MongoFileFinder ff(txn.get()); + MongoFileFinder ff(opCtx.get()); ASSERT(ff.findByPath(fn) == 0); } @@ -118,13 +118,14 @@ public: Timer t; for (int i = 0; i < N; i++) { // Every 4 iterations we pass the sequential hint. - DurableMappedFile f{ - txn.get(), i % 4 == 1 ? MongoFile::Options::SEQUENTIAL : MongoFile::Options::NONE}; - ON_BLOCK_EXIT([&f, &txn] { - LockMongoFilesExclusive lock(txn.get()); - f.close(txn.get()); + DurableMappedFile f{opCtx.get(), + i % 4 == 1 ? MongoFile::Options::SEQUENTIAL + : MongoFile::Options::NONE}; + ON_BLOCK_EXIT([&f, &opCtx] { + LockMongoFilesExclusive lock(opCtx.get()); + f.close(opCtx.get()); }); - verify(f.open(txn.get(), fn)); + verify(f.open(opCtx.get(), fn)); { char* p = (char*)f.getView(); verify(p); |