-
Notifications
You must be signed in to change notification settings - Fork 0
/
extent_protocol.h
56 lines (49 loc) · 901 Bytes
/
extent_protocol.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// extent wire protocol
#ifndef extent_protocol_h
#define extent_protocol_h
#include "rpc.h"
class extent_protocol {
public:
typedef int status;
typedef unsigned long long extentid_t;
enum xxstatus { OK, RPCERR, NOENT, IOERR };
enum rpc_numbers {
put = 0x6001,
get,
getattr,
remove
};
struct attr {
unsigned int atime;
unsigned int mtime;
unsigned int ctime;
unsigned int size;
attr(){}
attr(unsigned a, unsigned m, unsigned c, unsigned s)
{
atime = a;
mtime = m;
ctime = c;
size = s;
}
};
};
inline unmarshall &
operator>>(unmarshall &u, extent_protocol::attr &a)
{
u >> a.atime;
u >> a.mtime;
u >> a.ctime;
u >> a.size;
return u;
}
inline marshall &
operator<<(marshall &m, extent_protocol::attr a)
{
m << a.atime;
m << a.mtime;
m << a.ctime;
m << a.size;
return m;
}
#endif