diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-09-26 14:02:49 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-10-06 17:30:12 -0400 |
commit | 101e026f45dea5e9e68520238495c89a476e6172 (patch) | |
tree | bbdd3710ffc5721527ad9f5682ef0dbb4876dfee /src/mongo/db/commands/touch.cpp | |
parent | 10c86dc6cad9853514148e0ab59894a0d29353b9 (diff) | |
download | mongo-101e026f45dea5e9e68520238495c89a476e6172.tar.gz |
SERVER-14668/SERVER-15294 Collection-level locking for all read paths
Diffstat (limited to 'src/mongo/db/commands/touch.cpp')
-rw-r--r-- | src/mongo/db/commands/touch.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mongo/db/commands/touch.cpp b/src/mongo/db/commands/touch.cpp index 187ba27ab04..34cdc891c78 100644 --- a/src/mongo/db/commands/touch.cpp +++ b/src/mongo/db/commands/touch.cpp @@ -30,7 +30,7 @@ * it in the license file. */ -#include "mongo/pch.h" +#include "mongo/platform/basic.h" #include <string> #include <vector> @@ -41,8 +41,8 @@ #include "mongo/db/auth/privilege.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" +#include "mongo/db/client.h" #include "mongo/db/commands.h" -#include "mongo/db/curop.h" #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/jsobj.h" #include "mongo/db/operation_context_impl.h" @@ -85,7 +85,7 @@ namespace mongo { return false; } - NamespaceString nss( dbname, coll ); + const NamespaceString nss( dbname, coll ); if ( ! nss.isNormal() ) { errmsg = "bad namespace name"; return false; @@ -99,10 +99,9 @@ namespace mongo { return false; } - Client::ReadContext context(txn, nss.ns()); + AutoGetCollectionForRead context(txn, nss); - Database* db = context.ctx().db(); - Collection* collection = db->getCollection( txn, nss.ns() ); + Collection* collection = context.getCollection(); if ( !collection ) { errmsg = "collection not found"; return false; |