forked from caijieming-ng/SimpleDistributedFilesystem
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextent_server.h
More file actions
35 lines (25 loc) · 742 Bytes
/
extent_server.h
File metadata and controls
35 lines (25 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// this is the extent server
#ifndef extent_server_h
#define extent_server_h
#include <map>
#include <string>
#include "extent_protocol.h"
#include "lock.hpp"
#define ROOTDIR 0x00000001
struct file_inode {
extent_protocol::attr attributes;
extent_protocol::extentid_t id;
std::string file_buf;
};
class extent_server {
public:
extent_server();
int get(extent_protocol::extentid_t id, std::string &);
int getattr(extent_protocol::extentid_t id, extent_protocol::attr &);
int put(extent_protocol::extentid_t id, std::string, int &);
int remove(extent_protocol::extentid_t id, int &);
private:
base::Mutex _sync_root;
std::map<extent_protocol::extentid_t, file_inode*> _extent_map;
};
#endif