forked from zhangyi0x81/MIT-6.824-2012
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextent_server.cc
More file actions
44 lines (36 loc) · 1.02 KB
/
extent_server.cc
File metadata and controls
44 lines (36 loc) · 1.02 KB
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
// the extent server implementation
#include "extent_server.h"
#include <sstream>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
extent_server::extent_server() {}
int extent_server::put(extent_protocol::extentid_t id, std::string buf, int &)
{
// You fill this in for Lab 2.
return extent_protocol::IOERR;
}
int extent_server::get(extent_protocol::extentid_t id, std::string &buf)
{
// You fill this in for Lab 2.
return extent_protocol::IOERR;
}
int extent_server::getattr(extent_protocol::extentid_t id, extent_protocol::attr &a)
{
// You fill this in for Lab 2.
// You replace this with a real implementation. We send a phony response
// for now because it's difficult to get FUSE to do anything (including
// unmount) if getattr fails.
a.size = 0;
a.atime = 0;
a.mtime = 0;
a.ctime = 0;
return extent_protocol::OK;
}
int extent_server::remove(extent_protocol::extentid_t id, int &)
{
// You fill this in for Lab 2.
return extent_protocol::IOERR;
}