sapling/eden/fs/inodes/EdenDispatcherFactory.cpp
Xavier Deguillard ce50d2e34c fs: add an NfsDispatcher
Summary:
Similarly to what is done for FUSE and ProjectedFS, the dispatcher is the glue
that sits in between the protocol specific bits and the inodes layer.

For now, this only implements "getattr" but it will be filled overtime as more
RPC can be answered properly.

Reviewed By: kmancini

Differential Revision: D26389795

fbshipit-source-id: 19cf3457feec2ebc100e632cb28c20b11fdde26d
2021-02-17 23:32:38 -08:00

37 lines
953 B
C++

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#include "eden/fs/inodes/EdenDispatcherFactory.h"
#ifndef _WIN32
#include "eden/fs/inodes/FuseDispatcherImpl.h"
#include "eden/fs/inodes/NfsDispatcherImpl.h"
#else
#include "eden/fs/inodes/PrjfsDispatcherImpl.h"
#endif
namespace facebook::eden {
#ifndef _WIN32
std::unique_ptr<FuseDispatcher> EdenDispatcherFactory::makeFuseDispatcher(
EdenMount* mount) {
return std::make_unique<FuseDispatcherImpl>(mount);
}
std::unique_ptr<NfsDispatcher> EdenDispatcherFactory::makeNfsDispatcher(
EdenMount* mount) {
return std::make_unique<NfsDispatcherImpl>(mount);
}
#else
std::unique_ptr<PrjfsDispatcher> EdenDispatcherFactory::makePrjfsDispatcher(
EdenMount* mount) {
return std::make_unique<PrjfsDispatcherImpl>(mount);
}
#endif
} // namespace facebook::eden