mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 07:49:11 +03:00
make all of the FuseChannel handler methods private
Summary: Only the FuseChannel code should invoke the handler methods. This makes them all private. This did require making handlerMap be a private static member variable of FuseChannel so that it can access these methods during its initialization. Reviewed By: wez Differential Revision: D7126002 fbshipit-source-id: 28c421173cb6cf8b7a8e1ca085ad78ec9ea76b8f
This commit is contained in:
parent
bbb0b0cc0e
commit
0ac8eda5c8
@ -128,12 +128,14 @@ StringPiece fuseOpcodeName(FuseOpcode opcode) {
|
||||
using Handler = folly::Future<folly::Unit> (
|
||||
FuseChannel::*)(const fuse_in_header* header, const uint8_t* arg);
|
||||
|
||||
struct HandlerEntry {
|
||||
} // namespace
|
||||
|
||||
struct FuseChannel::HandlerEntry {
|
||||
Handler handler;
|
||||
EdenStats::HistogramPtr histogram;
|
||||
};
|
||||
|
||||
const std::unordered_map<uint32_t, HandlerEntry> handlerMap = {
|
||||
const FuseChannel::HandlerMap FuseChannel::handlerMap = {
|
||||
{FUSE_READ, {&FuseChannel::fuseRead, &EdenStats::read}},
|
||||
{FUSE_WRITE, {&FuseChannel::fuseWrite, &EdenStats::write}},
|
||||
{FUSE_LOOKUP, {&FuseChannel::fuseLookup, &EdenStats::lookup}},
|
||||
@ -168,7 +170,6 @@ const std::unordered_map<uint32_t, HandlerEntry> handlerMap = {
|
||||
{FUSE_BATCH_FORGET,
|
||||
{&FuseChannel::fuseBatchForget, &EdenStats::forgetmulti}},
|
||||
};
|
||||
} // namespace
|
||||
|
||||
static iovec inline make_iovec(const void* addr, size_t len) {
|
||||
iovec iov;
|
||||
|
@ -187,6 +187,21 @@ class FuseChannel {
|
||||
*/
|
||||
void finishRequest(const fuse_in_header& header);
|
||||
|
||||
/**
|
||||
* Returns a Future that will complete when all of the
|
||||
* fuse threads have been joined and when all pending
|
||||
* fuse requests initiated by the kernel have been
|
||||
* responded to.
|
||||
* Will throw if called more than once.
|
||||
*/
|
||||
folly::Future<folly::Unit> getSessionCompleteFuture();
|
||||
|
||||
private:
|
||||
struct HandlerEntry;
|
||||
using HandlerMap = std::unordered_map<uint32_t, HandlerEntry>;
|
||||
|
||||
static const HandlerMap handlerMap;
|
||||
|
||||
folly::Future<folly::Unit> fuseRead(
|
||||
const fuse_in_header* header,
|
||||
const uint8_t* arg);
|
||||
@ -281,16 +296,6 @@ class FuseChannel {
|
||||
const fuse_in_header* header,
|
||||
const uint8_t* arg);
|
||||
|
||||
/**
|
||||
* Returns a Future that will complete when all of the
|
||||
* fuse threads have been joined and when all pending
|
||||
* fuse requests initiated by the kernel have been
|
||||
* responded to.
|
||||
* Will throw if called more than once.
|
||||
*/
|
||||
folly::Future<folly::Unit> getSessionCompleteFuture();
|
||||
|
||||
private:
|
||||
void fuseWorkerThread(size_t threadNumber);
|
||||
void maybeDispatchSessionComplete();
|
||||
void readInitPacket();
|
||||
|
Loading…
Reference in New Issue
Block a user