From d559d2d217c9dd69900dc3d037274fdcd31e759e Mon Sep 17 00:00:00 2001 From: Xavier Deguillard Date: Mon, 8 Jun 2020 12:42:36 -0700 Subject: [PATCH] mount: remove most of the ifdef in EdenServer::mount Summary: The only missing piece on Windows is the bind mount/redirection due to folly::Subprocess not being present on Windows. Reviewed By: wez Differential Revision: D21676313 fbshipit-source-id: a5ba09be04c94b66edf9d40884753afa3865def2 --- eden/fs/service/EdenServer.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/eden/fs/service/EdenServer.cpp b/eden/fs/service/EdenServer.cpp index 96223c1393..e4f6b3cb25 100644 --- a/eden/fs/service/EdenServer.cpp +++ b/eden/fs/service/EdenServer.cpp @@ -1253,9 +1253,6 @@ folly::Future> EdenServer::mount( std::move(result).exception()); } -#ifdef _WIN32 - return makeFuture>(std::move(edenMount)); -#else // Now that we've started the workers, arrange to call // mountFinished once the pool is torn down. auto finishFuture = @@ -1274,6 +1271,10 @@ folly::Future> EdenServer::mount( return makeFuture>( std::move(edenMount)); } else { +#ifdef _WIN32 + return makeFuture>( + std::move(edenMount)); +#else // Perform all of the bind mounts associated with the // client. We don't need to do this for the takeover // case as they are already mounted. @@ -1286,11 +1287,10 @@ folly::Future> EdenServer::mount( return edenMount; }) .via(getServerState()->getThreadPool().get()); +#endif } }) .thenTry([this, mountStopWatch, doTakeover, edenMount](auto&& t) { - // TODO: Include this to work on Windows when getting the event - // logging working. FinishedMount event; event.repo_type = edenMount->getConfig()->getRepoType(); event.repo_source = @@ -1300,10 +1300,13 @@ folly::Future> EdenServer::mount( std::chrono::duration{mountStopWatch.elapsed()} .count(); event.success = !t.hasException(); +#ifndef _WIN32 event.clean = edenMount->getOverlay()->hadCleanStartup(); +#else + event.clean = true; +#endif serverState_->getStructuredLogger()->logEvent(event); return makeFuture(std::move(t)); -#endif }); }); }