Commit dc84e907 authored by Chrysostomos Nanakos's avatar Chrysostomos Nanakos

Add Pithos+ disk type

parent 1452b09d
......@@ -78,6 +78,7 @@ libtapdisk_la_SOURCES += block-vindex.c
libtapdisk_la_SOURCES += block-lcache.c
libtapdisk_la_SOURCES += block-llcache.c
libtapdisk_la_SOURCES += block-archipelago.c
libtapdisk_la_SOURCES += block-pithos.c
libtapdisk_la_LIBADD = ../vhd/lib/libvhd.la
libtapdisk_la_LIBADD += -laio -lxseg
......@@ -83,22 +83,17 @@ typedef struct AIORequestData {
} AIORequestData;
struct xseg *xseg = NULL;
xport srcport = NoPort;
struct xseg_port *port;
xport mportno = NoPort;
xport vportno = NoPort;
struct posixfd_signal_desc {
char signal_file[sizeof(void *)];
int fd;
int flag;
};
static struct xseg *xseg = NULL;
static xport srcport = NoPort;
static struct xseg_port *port;
static xport mportno = NoPort;
static xport vportno = NoPort;
struct tdarchipelago_data {
/* Archipelago Volume Name and Size */
char *volname;
ssize_t size;
uint64_t size;
/* Requests Queue */
struct list_head reqs_inflight;
......@@ -147,16 +142,16 @@ static void tdarchipelago_pipe_read_cb(event_id_t eb, char mode, void *data);
static int wait_reply(struct xseg_request *expected_req)
{
struct xseg_request *rec;
struct xseg_request *req;
xseg_prepare_wait(xseg, srcport);
struct posixfd_signal_desc *psd = xseg_get_signal_desc(xseg, port);
void *psd = xseg_get_signal_desc(xseg, port);
while(1) {
rec = xseg_receive(xseg, srcport, 0);
if(rec) {
if( rec != expected_req) {
req = xseg_receive(xseg, srcport, 0);
if(req) {
if( req != expected_req) {
DPRINTF("wait_reply(): Unknown request.\n");
xseg_put_request(xseg, rec, srcport);
} else if(!(rec->state & XS_SERVED)) {
xseg_put_request(xseg, req, srcport);
} else if(!(req->state & XS_SERVED)) {
DPRINTF("wait_reply(): Failed request.\n");
return -1;
} else {
......@@ -171,7 +166,7 @@ static int wait_reply(struct xseg_request *expected_req)
static void xseg_request_handler(void *arthd)
{
struct posixfd_signal_desc *psd = xseg_get_signal_desc(xseg, port);
void *psd = xseg_get_signal_desc(xseg, port);
ArchipelagoThread *th = (ArchipelagoThread *) arthd;
while(th->is_running) {
struct xseg_request *req;
......
This diff is collapsed.
......@@ -133,6 +133,12 @@ static const disk_info_t archipelago_disk = {
0,
};
static const disk_info_t pithos_disk = {
"pithos",
"Pithos+ image",
0,
};
const disk_info_t *tapdisk_disk_types[] = {
[DISK_TYPE_AIO] = &aio_disk,
[DISK_TYPE_SYNC] = &sync_disk,
......@@ -150,6 +156,7 @@ const disk_info_t *tapdisk_disk_types[] = {
[DISK_TYPE_LLPCACHE] = &llpcache_disk,
[DISK_TYPE_LLECACHE] = &llecache_disk,
[DISK_TYPE_ARCHIPELAGO] = &archipelago_disk,
[DISK_TYPE_PITHOS] = &pithos_disk,
0,
};
......@@ -175,6 +182,7 @@ extern struct tap_disk tapdisk_llecache;
extern struct tap_disk tapdisk_valve;
extern struct tap_disk tapdisk_archipelago;
extern struct tap_disk tapdisk_pithos;
const struct tap_disk *tapdisk_disk_drivers[] = {
[DISK_TYPE_AIO] = &tapdisk_aio,
......@@ -198,6 +206,7 @@ const struct tap_disk *tapdisk_disk_drivers[] = {
[DISK_TYPE_LLECACHE] = &tapdisk_llecache,
[DISK_TYPE_VALVE] = &tapdisk_valve,
[DISK_TYPE_ARCHIPELAGO] = &tapdisk_archipelago,
[DISK_TYPE_PITHOS] = &tapdisk_pithos,
0,
};
......
......@@ -45,6 +45,7 @@
#define DISK_TYPE_LLPCACHE 13
#define DISK_TYPE_VALVE 14
#define DISK_TYPE_ARCHIPELAGO 15
#define DISK_TYPE_PITHOS 16
#define DISK_TYPE_NAME_MAX 32
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment