summaryrefslogtreecommitdiff
path: root/src/mongo/db/db_raii.cpp
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2015-05-15 14:39:52 -0400
committerAndy Schwerin <schwerin@mongodb.com>2015-05-18 13:39:23 -0400
commitd5bf63455aa614d98ac840f09ce5ca6b813b9507 (patch)
treeba5161195343c4b9b5d5dadea9ea3b6d7e86fd1f /src/mongo/db/db_raii.cpp
parentbb3c301d62a8c5601fb0bed176013ef7ac0a3720 (diff)
downloadmongo-d5bf63455aa614d98ac840f09ce5ca6b813b9507.tar.gz
SERVER-18515 Replace OperationContext::getCurOp with CurOp::get(OperationContext*)
Diffstat (limited to 'src/mongo/db/db_raii.cpp')
-rw-r--r--src/mongo/db/db_raii.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mongo/db/db_raii.cpp b/src/mongo/db/db_raii.cpp
index 937b474ebb2..5a78f2d7d90 100644
--- a/src/mongo/db/db_raii.cpp
+++ b/src/mongo/db/db_raii.cpp
@@ -86,8 +86,8 @@ namespace mongo {
massert(28535, "need a non-empty collection name", !coll.empty());
// TODO: OldClientContext legacy, needs to be removed
- _txn->getCurOp()->ensureStarted();
- _txn->getCurOp()->setNS(ns);
+ CurOp::get(_txn)->ensureStarted();
+ CurOp::get(_txn)->setNS(ns);
// We have both the DB and collection locked, which the prerequisite to do a stable shard
// version check.
@@ -97,7 +97,7 @@ namespace mongo {
// constructor, so it is safe to load the DB pointer.
if (_db.getDb()) {
// TODO: OldClientContext legacy, needs to be removed
- _txn->getCurOp()->enter(ns.c_str(), _db.getDb()->getProfilingLevel());
+ CurOp::get(_txn)->enter(ns.c_str(), _db.getDb()->getProfilingLevel());
_coll = _db.getDb()->getCollection(ns);
}
@@ -105,7 +105,7 @@ namespace mongo {
AutoGetCollectionForRead::~AutoGetCollectionForRead() {
// Report time spent in read lock
- _txn->getCurOp()->recordGlobalTime(false, _timer.micros());
+ CurOp::get(_txn)->recordGlobalTime(false, _timer.micros());
}
@@ -156,11 +156,11 @@ namespace mongo {
_checkNotStale();
}
- _txn->getCurOp()->enter(_ns.c_str(), _db->getProfilingLevel());
+ CurOp::get(_txn)->enter(_ns.c_str(), _db->getProfilingLevel());
}
void OldClientContext::_checkNotStale() const {
- switch (_txn->getCurOp()->getOp()) {
+ switch (CurOp::get(_txn)->getOp()) {
case dbGetMore: // getMore is special and should be handled elsewhere.
case dbUpdate: // update & delete check shard version in instance.cpp, so don't check
case dbDelete: // here as well.
@@ -174,7 +174,7 @@ namespace mongo {
// Lock must still be held
invariant(_txn->lockState()->isLocked());
- _txn->getCurOp()->recordGlobalTime(_txn->lockState()->isWriteLocked(), _timer.micros());
+ CurOp::get(_txn)->recordGlobalTime(_txn->lockState()->isWriteLocked(), _timer.micros());
}