mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 06:18:07 +03:00
Switch to new EdenMount
Summary: This diff enabled building the Inodes code on the Windows platform. With this we also swtich to using the new merged version of EdenMount. From this diff onwards Eden Windows works with Inodes. Reviewed By: simpkins Differential Revision: D20955997 fbshipit-source-id: 9b9d8bf56c352c98a3018e5bb389e35489ebd6fb
This commit is contained in:
parent
d2c6eaff04
commit
133e5faa7c
@ -3,47 +3,61 @@
|
||||
# This software may be used and distributed according to the terms of the
|
||||
# GNU General Public License version 2.
|
||||
|
||||
if (WIN32)
|
||||
# We should try detaching ServerState from the inodes
|
||||
# so that we don't need to make the Windows code depend
|
||||
# on it.
|
||||
add_library(
|
||||
eden_inodes STATIC
|
||||
ServerState.cpp
|
||||
win/DirList.cpp
|
||||
win/DirList.h
|
||||
win/EdenMount.cpp
|
||||
win/EdenMount.h
|
||||
win/RepoConfig.cpp
|
||||
win/RepoConfig.h
|
||||
if(WIN32)
|
||||
file(GLOB INODES_SRCS "*.cpp" "win/*.cpp" "sqliteoverlay/*.cpp")
|
||||
list(
|
||||
REMOVE_ITEM
|
||||
INODES_SRCS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/EdenDispatcher.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/GlobNode.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/OverlayFile.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/OverlayFileAccess.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/InodeMetadata.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/win/EdenMount.cpp
|
||||
)
|
||||
target_link_libraries(
|
||||
eden_inodes
|
||||
PUBLIC
|
||||
eden_journal
|
||||
eden_store
|
||||
Folly::folly
|
||||
list(
|
||||
APPEND
|
||||
INODES_SRCS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../fuse/InodeNumber.cpp
|
||||
)
|
||||
else()
|
||||
file(GLOB INODES_SRCS "*.cpp")
|
||||
add_library(
|
||||
eden_inodes STATIC
|
||||
${INODES_SRCS}
|
||||
)
|
||||
endif()
|
||||
|
||||
add_library(
|
||||
eden_inodes STATIC
|
||||
${INODES_SRCS}
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
eden_inodes
|
||||
PUBLIC
|
||||
eden_config
|
||||
eden_journal
|
||||
eden_model_git
|
||||
eden_overlay_thrift_cpp
|
||||
eden_service_thrift_util
|
||||
eden_sqlite
|
||||
eden_store
|
||||
eden_telemetry
|
||||
eden_utils
|
||||
Folly::folly
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(
|
||||
eden_inodes
|
||||
PUBLIC
|
||||
eden_win_utils
|
||||
)
|
||||
else()
|
||||
target_link_libraries(
|
||||
eden_inodes
|
||||
PUBLIC
|
||||
eden_config
|
||||
eden_fuse
|
||||
eden_journal
|
||||
eden_model_git
|
||||
eden_overlay_thrift_cpp
|
||||
eden_overlay
|
||||
eden_service
|
||||
eden_store
|
||||
eden_takeover_thrift
|
||||
eden_telemetry
|
||||
eden_utils
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <thrift/lib/cpp2/server/ThriftServer.h>
|
||||
|
||||
#include "eden/fs/config/CheckoutConfig.h"
|
||||
#include "eden/fs/inodes/EdenMount.h"
|
||||
#include "eden/fs/service/EdenCPUThreadPool.h"
|
||||
#include "eden/fs/service/EdenError.h"
|
||||
#include "eden/fs/service/EdenServiceHandler.h"
|
||||
@ -52,7 +53,6 @@
|
||||
#include "eden/fs/utils/ProcUtil.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "eden/fs/inodes/win/EdenMount.h" // @manual
|
||||
#include "eden/fs/win/mount/PrjfsChannel.h" // @manual
|
||||
#include "eden/fs/win/service/StartupLogger.h" // @manual
|
||||
#include "eden/fs/win/utils/FileUtils.h" // @manual
|
||||
@ -61,7 +61,6 @@
|
||||
#include "eden/fs/fuse/FuseChannel.h"
|
||||
#include "eden/fs/fuse/privhelper/PrivHelper.h"
|
||||
#include "eden/fs/inodes/EdenDispatcher.h"
|
||||
#include "eden/fs/inodes/EdenMount.h"
|
||||
#include "eden/fs/inodes/InodeMap.h"
|
||||
#include "eden/fs/inodes/Overlay.h"
|
||||
#include "eden/fs/inodes/TreeInode.h"
|
||||
@ -1130,22 +1129,6 @@ folly::Future<std::shared_ptr<EdenMount>> EdenServer::mount(
|
||||
serverState_->getThreadPool().get());
|
||||
auto journal = std::make_unique<Journal>(getSharedStats());
|
||||
|
||||
#if _WIN32
|
||||
// Create the EdenMount object and insert the mount into the mountPoints_
|
||||
// map.
|
||||
auto edenMount = EdenMount::create(
|
||||
std::move(initialConfig),
|
||||
std::move(objectStore),
|
||||
blobCache_,
|
||||
serverState_,
|
||||
std::move(journal));
|
||||
edenMount->initialize(std::make_unique<PrjfsChannel>(edenMount.get()));
|
||||
addToMountPoints(edenMount);
|
||||
edenMount->start();
|
||||
(void)mountStopWatch;
|
||||
return makeFuture<std::shared_ptr<EdenMount>>(std::move(edenMount));
|
||||
|
||||
#else
|
||||
// Create the EdenMount object and insert the mount into the mountPoints_ map.
|
||||
auto edenMount = EdenMount::create(
|
||||
std::move(initialConfig),
|
||||
@ -1154,6 +1137,16 @@ folly::Future<std::shared_ptr<EdenMount>> EdenServer::mount(
|
||||
serverState_,
|
||||
std::move(journal));
|
||||
addToMountPoints(edenMount);
|
||||
|
||||
#ifdef _WIN32
|
||||
(void)
|
||||
mountStopWatch; // TODO: log to StructuredLogger once supported on Windows
|
||||
return edenMount->initialize(std::make_unique<PrjfsChannel>(edenMount.get()))
|
||||
.thenValue([edenMount](folly::Unit) {
|
||||
edenMount->start();
|
||||
return edenMount;
|
||||
});
|
||||
#else
|
||||
registerStats(edenMount);
|
||||
|
||||
// Now actually begin starting the mount point
|
||||
@ -1221,6 +1214,8 @@ folly::Future<std::shared_ptr<EdenMount>> EdenServer::mount(
|
||||
}
|
||||
})
|
||||
.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 =
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <condition_variable>
|
||||
|
||||
#include "eden/fs/config/EdenConfig.h"
|
||||
#include "eden/fs/inodes/EdenMount.h"
|
||||
#include "eden/fs/inodes/ServerState.h"
|
||||
#include "eden/fs/service/EdenStateDir.h"
|
||||
#include "eden/fs/service/PeriodicTask.h"
|
||||
@ -36,12 +37,10 @@
|
||||
#include "eden/fs/utils/PathFuncs.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "eden/fs/inodes/win/EdenMount.h" // @manual
|
||||
#include "eden/fs/win/utils/Stub.h" // @manual
|
||||
#include "eden/fs/win/utils/UserInfo.h" // @manual
|
||||
#else
|
||||
#include "eden/fs/fuse/FuseTypes.h"
|
||||
#include "eden/fs/inodes/EdenMount.h"
|
||||
#include "eden/fs/takeover/TakeoverData.h"
|
||||
#endif
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <folly/Format.h>
|
||||
#include <folly/logging/xlog.h>
|
||||
#include "ProjectedFSLib.h"
|
||||
#include "eden/fs/inodes/win/EdenMount.h"
|
||||
#include "eden/fs/inodes/EdenMount.h"
|
||||
#include "eden/fs/model/Blob.h"
|
||||
#include "eden/fs/model/Tree.h"
|
||||
#include "eden/fs/service/EdenError.h"
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include <folly/logging/xlog.h>
|
||||
#include <string>
|
||||
#include "eden/fs/inodes/win/EdenMount.h"
|
||||
#include "eden/fs/inodes/EdenMount.h"
|
||||
#include "eden/fs/win/mount/EdenDispatcher.h"
|
||||
#include "eden/fs/win/utils/Guid.h"
|
||||
#include "eden/fs/win/utils/StringConv.h"
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <folly/logging/xlog.h>
|
||||
#include <cstring>
|
||||
#include <shared_mutex>
|
||||
#include "eden/fs/inodes/win/EdenMount.h"
|
||||
#include "eden/fs/inodes/EdenMount.h"
|
||||
#include "eden/fs/model/Blob.h"
|
||||
#include "eden/fs/model/Tree.h"
|
||||
#include "eden/fs/service/EdenError.h"
|
||||
|
@ -47,14 +47,6 @@ class FakePrivHelper : public PrivHelper {
|
||||
using uid_t = int;
|
||||
using gid_t = int;
|
||||
|
||||
struct InodePtr {
|
||||
int stub;
|
||||
};
|
||||
|
||||
struct TreeInodePtr {
|
||||
int stub;
|
||||
};
|
||||
|
||||
class TakeoverData {
|
||||
public:
|
||||
int stub;
|
||||
|
Loading…
Reference in New Issue
Block a user