-
Notifications
You must be signed in to change notification settings - Fork 0
/
extent_protocol.h
54 lines (47 loc) · 873 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
// 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, FBIG};
enum rpc_numbers {
put = 0x6001,
create,
update,
updateAll,
retrieve,
retrieveAll,
getattr,
setattr,
remove
};
static const unsigned int maxextent = 8192*1000;
struct attr {
unsigned int atime;
unsigned int mtime;
unsigned int ctime;
unsigned int size;
};
};
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