File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1948,9 +1948,8 @@ folly::coro::now_task<std::optional<Hash32>> TreeInode::co_getDigestHash(
19481948 treeId = state->treeId .value ();
19491949 }
19501950 // ObjectStore::getTreeDigestHash has no co_ version yet, bridge via .semi()
1951- co_return co_await getObjectStore ()
1952- .getTreeDigestHash (treeId, fetchContext)
1953- .semi ();
1951+ co_return co_await getObjectStore ().co_getTreeDigestHash (
1952+ treeId, fetchContext);
19541953}
19551954
19561955ImmediateFuture<std::optional<uint64_t >> TreeInode::getDigestSize (
Original file line number Diff line number Diff line change @@ -272,17 +272,14 @@ folly::coro::now_task<std::optional<Hash32>> VirtualInode::co_getDigestHash(
272272 } else if (
273273 auto * entry =
274274 std::get_if<UnmaterializedUnloadedBlobDirEntry>(&variant_)) {
275- co_return co_await objectStore
276- ->getTreeDigestHash (entry->getObjectId (), fetchContext)
277- .semi ();
275+ co_return co_await objectStore->co_getTreeDigestHash (
276+ entry->getObjectId (), fetchContext);
278277 } else if (auto * tree = std::get_if<TreePtr>(&variant_)) {
279- co_return co_await objectStore
280- ->getTreeDigestHash ((*tree)->getObjectId (), fetchContext)
281- .semi ();
278+ co_return co_await objectStore->co_getTreeDigestHash (
279+ (*tree)->getObjectId (), fetchContext);
282280 } else if (auto * treeEntry = std::get_if<TreeEntry>(&variant_)) {
283- co_return co_await objectStore
284- ->getTreeDigestHash (treeEntry->getObjectId (), fetchContext)
285- .semi ();
281+ co_return co_await objectStore->co_getTreeDigestHash (
282+ treeEntry->getObjectId (), fetchContext);
286283 } else {
287284 co_yield folly::coro::co_error (PathError (
288285 EINVAL , path, std::string_view{" variant is of unhandled type" }));
Original file line number Diff line number Diff line change @@ -517,6 +517,13 @@ ImmediateFuture<std::optional<Hash32>> ObjectStore::getTreeDigestHash(
517517 });
518518}
519519
520+ folly::coro::now_task<std::optional<Hash32>> ObjectStore::co_getTreeDigestHash (
521+ const ObjectId& id,
522+ const ObjectFetchContextPtr& context) const {
523+ auto auxData = co_await co_getTreeAuxData (id, context);
524+ co_return auxData.has_value () ? auxData->digestHash : std::nullopt ;
525+ }
526+
520527ImmediateFuture<std::optional<uint64_t >> ObjectStore::getTreeDigestSize (
521528 const ObjectId& id,
522529 const ObjectFetchContextPtr& context) const {
Original file line number Diff line number Diff line change @@ -251,11 +251,17 @@ class ObjectStore : public IObjectStore,
251251
252252 /* *
253253 * Returns the DigestHash hash of the contents of the tree with the given ID.
254+ *
255+ * DEPRECATED: Use co_getTreeDigestHash instead.
254256 */
255257 ImmediateFuture<std::optional<Hash32>> getTreeDigestHash (
256258 const ObjectId& id,
257259 const ObjectFetchContextPtr& context) const ;
258260
261+ folly::coro::now_task<std::optional<Hash32>> co_getTreeDigestHash (
262+ const ObjectId& id,
263+ const ObjectFetchContextPtr& context) const ;
264+
259265 /* *
260266 * Returns the digest size of the tree with the given ID.
261267 */
You can’t perform that action at this time.
0 commit comments