summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/touch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/touch.cpp')
-rw-r--r--src/mongo/db/commands/touch.cpp11
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;