diff options
author | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2017-10-19 16:31:40 -0400 |
---|---|---|
committer | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2017-10-30 10:03:18 -0400 |
commit | ec52a8bdc9428508229c81836206679010eb31b5 (patch) | |
tree | 08f65ab3a253caa79870c6e1dd0c7a78797da16b | |
parent | 9becaec05921e0fd6eeb3e7bdf8c91ca1f6531c7 (diff) | |
download | mongo-ec52a8bdc9428508229c81836206679010eb31b5.tar.gz |
SERVER-24344 Calls to take resource lock unnecessarily check for null Locker on OperationContext
-rw-r--r-- | src/mongo/db/storage/kv/kv_catalog.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mongo/db/storage/kv/kv_catalog.cpp b/src/mongo/db/storage/kv/kv_catalog.cpp index b93b66178da..02e0d99dcd2 100644 --- a/src/mongo/db/storage/kv/kv_catalog.cpp +++ b/src/mongo/db/storage/kv/kv_catalog.cpp @@ -341,8 +341,7 @@ Status KVCatalog::newCollection(OperationContext* opCtx, StringData ns, const CollectionOptions& options, KVPrefix prefix) { - invariant(opCtx->lockState() == NULL || - opCtx->lockState()->isDbLockedForMode(nsToDatabaseSubstring(ns), MODE_X)); + invariant(opCtx->lockState()->isDbLockedForMode(nsToDatabaseSubstring(ns), MODE_X)); const string ident = _newUniqueIdent(ns, "collection"); @@ -508,8 +507,7 @@ Status KVCatalog::renameCollection(OperationContext* opCtx, } Status KVCatalog::dropCollection(OperationContext* opCtx, StringData ns) { - invariant(opCtx->lockState() == NULL || - opCtx->lockState()->isDbLockedForMode(nsToDatabaseSubstring(ns), MODE_X)); + invariant(opCtx->lockState()->isDbLockedForMode(nsToDatabaseSubstring(ns), MODE_X)); stdx::lock_guard<stdx::mutex> lk(_identsLock); const NSToIdentMap::iterator it = _idents.find(ns.toString()); if (it == _idents.end()) { |