diff options
author | Maria van Keulen <maria@mongodb.com> | 2017-03-07 12:00:08 -0500 |
---|---|---|
committer | Maria van Keulen <maria@mongodb.com> | 2017-03-07 12:00:08 -0500 |
commit | 589a5c169ced8f6e9ddcd3d182ae1b75db6b7d79 (patch) | |
tree | c7a090ffdd56a91ae677e2492c61b820af44f964 /src/mongo/dbtests/mmaptests.cpp | |
parent | 3cba97198638df3750e3b455e2ad57af7ee536ae (diff) | |
download | mongo-589a5c169ced8f6e9ddcd3d182ae1b75db6b7d79.tar.gz |
SERVER-27938 Rename all OperationContext variables to opCtx
This commit is an automated rename of all whole word instances of txn,
_txn, and txnPtr to opCtx, _opCtx, and opCtxPtr, respectively in all
.cpp and .h files in src/mongo.
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); |