1 | // SPDX-License-Identifier: GPL-3.0-or-later |
---|---|
2 | |
3 | #pragma once |
4 | |
5 | #include "proto/filesystem.pb.h" |
6 | #include "proto/filesystem.services.h" |
7 | #include "proto/userfs-manager.services.h" |
8 | |
9 | #include <librpc/macro_magic.h> |
10 | #include <librpc/rpc.h> |
11 | #include <librpc/rpc_client.h> |
12 | #include <librpc/rpc_server++.hpp> |
13 | #include <mos/proto/fs_server.h> |
14 | #include <pb_decode.h> |
15 | #include <string> |
16 | |
17 | class BlockdevFSServer : public IUserFSService |
18 | { |
19 | public: |
20 | explicit BlockdevFSServer(const std::string &servername) : IUserFSService(servername) |
21 | { |
22 | } |
23 | |
24 | virtual ~BlockdevFSServer() = default; |
25 | |
26 | private: |
27 | rpc_result_code_t mount(rpc_context_t *, mosrpc_fs_mount_request *req, mosrpc_fs_mount_response *resp) override; |
28 | rpc_result_code_t readdir(rpc_context_t *, mosrpc_fs_readdir_request *req, mosrpc_fs_readdir_response *resp) override; |
29 | rpc_result_code_t lookup(rpc_context_t *, mosrpc_fs_lookup_request *req, mosrpc_fs_lookup_response *resp) override; |
30 | }; |
31 |