diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-05-15 15:20:11 -0400 |
---|---|---|
committer | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-05-15 15:35:38 -0400 |
commit | 9af1defd2b1b831322e716baa8a4e54b27bd534a (patch) | |
tree | eaded148b88afb2d843dc821308621f7abf9ddc3 /src/mongo/db/storage/kv | |
parent | 6fdacbfe6dce35b538b5ee00305fae4b9cd07fb2 (diff) | |
download | mongo-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.cpp | 5 |
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; |