summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/kv
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-05-15 15:20:11 -0400
committerGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-05-15 15:35:38 -0400
commit9af1defd2b1b831322e716baa8a4e54b27bd534a (patch)
treeeaded148b88afb2d843dc821308621f7abf9ddc3 /src/mongo/db/storage/kv
parent6fdacbfe6dce35b538b5ee00305fae4b9cd07fb2 (diff)
downloadmongo-9af1defd2b1b831322e716baa8a4e54b27bd534a.tar.gz
SERVER-37988 Add an optional predicate argument in forEachCollectionFromDb() to allow skipping unsatisfied collections without grabbing them in the desired lock mode
Diffstat (limited to 'src/mongo/db/storage/kv')
-rw-r--r--src/mongo/db/storage/kv/kv_storage_engine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/storage/kv/kv_storage_engine.cpp b/src/mongo/db/storage/kv/kv_storage_engine.cpp
index d922f598d8e..9931bcf93ee 100644
--- a/src/mongo/db/storage/kv/kv_storage_engine.cpp
+++ b/src/mongo/db/storage/kv/kv_storage_engine.cpp
@@ -915,7 +915,10 @@ int64_t KVStorageEngine::sizeOnDiskForDb(OperationContext* opCtx, StringData dbN
int64_t size = 0;
catalog::forEachCollectionFromDb(
- opCtx, dbName, MODE_IS, [&](Collection* collection, CollectionCatalogEntry* catalogEntry) {
+ opCtx,
+ dbName,
+ MODE_IS,
+ [&](const Collection* collection, const CollectionCatalogEntry* catalogEntry) {
size += catalogEntry->getRecordStore()->storageSize(opCtx);
std::vector<std::string> indexNames;