summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/compact.cpp
diff options
context:
space:
mode:
authorGeert Bosch <geert@mongodb.com>2014-09-25 14:41:01 -0400
committerGeert Bosch <geert@mongodb.com>2014-09-25 18:12:34 -0400
commit962f959a09b63aa0482d7e0c9bad89363d1e1194 (patch)
tree975a9ff722ec19992c15feb9d3fd1587278afc3c /src/mongo/db/commands/compact.cpp
parent77b00970997d13d0758c745e5a94fc79982d4401 (diff)
downloadmongo-962f959a09b63aa0482d7e0c9bad89363d1e1194.tar.gz
SERVER-14668: Replace uses of DBWrite lock with DBLock
Make the lock mode explicit as preparation to move some to intent locks, and use proper database name instead of full namespace string to lock databases.
Diffstat (limited to 'src/mongo/db/commands/compact.cpp')
-rw-r--r--src/mongo/db/commands/compact.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/commands/compact.cpp b/src/mongo/db/commands/compact.cpp
index 5ed0ac16aca..8ffac0bff38 100644
--- a/src/mongo/db/commands/compact.cpp
+++ b/src/mongo/db/commands/compact.cpp
@@ -97,7 +97,7 @@ namespace mongo {
return false;
}
- NamespaceString ns(db,coll);
+ NamespaceString ns(db, coll);
if ( !ns.isNormal() ) {
errmsg = "bad namespace name";
return false;
@@ -144,7 +144,7 @@ namespace mongo {
compactOptions.validateDocuments = cmdObj["validate"].trueValue();
- Lock::DBWrite lk(txn->lockState(), ns.ns());
+ Lock::DBLock lk(txn->lockState(), db, newlm::MODE_X);
BackgroundOperation::assertNoBgOpInProgForNs(ns.ns());
Client::Context ctx(txn, ns);