Rename project from TinyDFS to MouseFS
- Renamed TinyDFS.h to MouseFS.h - Updated all type names: TinyDFS -> MouseFS, TinyDFS_Entity -> MouseFS_Entity, TinyDFS_Result -> MouseFS_Result - Updated all enum values: TINYDFS_RESULT_* -> MOUSEFS_RESULT_* - Updated all function names: tinydfs_* -> mousefs_* - Updated all variable names: tdfs -> mfs - Updated references in all source files, headers, examples, and documentation - Updated Makefile build targets: tinydfs_* -> mousefs_*
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
Architecture
|
Architecture
|
||||||
A TinyDFS instance is composed by a metadata server, a number
|
A MouseFS instance is composed by a metadata server, a number
|
||||||
of chunk servers, and a number of clients.
|
of chunk servers, and a number of clients.
|
||||||
|
|
||||||
The metadata server stores the full file system hieararchy,
|
The metadata server stores the full file system hieararchy,
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ HFILES = $(shell find src -name '*.h')
|
|||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
|
|
||||||
all: tinydfs_server$(EXT) tinydfs_test$(EXT) example_client$(EXT)
|
all: mousefs_server$(EXT) mousefs_test$(EXT) example_client$(EXT)
|
||||||
|
|
||||||
tinydfs_server$(EXT): $(CFILES) $(HFILES)
|
mousefs_server$(EXT): $(CFILES) $(HFILES)
|
||||||
gcc -o $@ $(CFILES) $(CFLAGS) $(LFLAGS) -Iinc -DBUILD_SERVER
|
gcc -o $@ $(CFILES) $(CFLAGS) $(LFLAGS) -Iinc -DBUILD_SERVER
|
||||||
|
|
||||||
tinydfs_test$(EXT): $(CFILES) $(HFILES)
|
mousefs_test$(EXT): $(CFILES) $(HFILES)
|
||||||
gcc -o $@ $(CFILES) $(CFLAGS) $(LFLAGS) -Iinc -DBUILD_TEST
|
gcc -o $@ $(CFILES) $(CFLAGS) $(LFLAGS) -Iinc -DBUILD_TEST
|
||||||
|
|
||||||
example_client$(EXT): examples/main.c $(CFILES) $(HFILES)
|
example_client$(EXT): examples/main.c $(CFILES) $(HFILES)
|
||||||
@@ -27,9 +27,9 @@ example_client$(EXT): examples/main.c $(CFILES) $(HFILES)
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm \
|
rm \
|
||||||
tinydfs_server.exe \
|
mousefs_server.exe \
|
||||||
tinydfs_server.out \
|
mousefs_server.out \
|
||||||
tinydfs_test.exe \
|
mousefs_test.exe \
|
||||||
tinydfs_test.out \
|
mousefs_test.out \
|
||||||
example_client.exe \
|
example_client.exe \
|
||||||
example_client.out
|
example_client.out
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
- Clean up the read operation for clients
|
- Clean up the read operation for clients
|
||||||
- Check that the corner case where read and writes go over the length of the file work correctly
|
- Check that the corner case where read and writes go over the length of the file work correctly
|
||||||
- When a client received metadata and starts reading or writing to a chunk server, it should try connecting to all addresses of a chunk servers, not just the first one.
|
- When a client received metadata and starts reading or writing to a chunk server, it should try connecting to all addresses of a chunk servers, not just the first one.
|
||||||
- Return the number of bytes read or written in the TinyDFS_Result struct
|
- Return the number of bytes read or written in the MouseFS_Result struct
|
||||||
- Make parallel uploads/downloads configurable
|
- Make parallel uploads/downloads configurable
|
||||||
- Recalculate next write locations whenever a write occurs, not at each read
|
- Recalculate next write locations whenever a write occurs, not at each read
|
||||||
- avoid replay attacks
|
- avoid replay attacks
|
||||||
|
|||||||
+14
-14
@@ -1,39 +1,39 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <TinyDFS.h>
|
#include <MouseFS.h>
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
TinyDFS *tdfs = tinydfs_init("127.0.0.1", 8080);
|
MouseFS *mfs = mousefs_init("127.0.0.1", 8080);
|
||||||
if (tdfs == NULL)
|
if (mfs == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (tinydfs_submit_create(tdfs, "/my_file_1", -1, false, 1024) < 0) {
|
if (mousefs_submit_create(mfs, "/my_file_1", -1, false, 1024) < 0) {
|
||||||
tinydfs_free(tdfs);
|
mousefs_free(mfs);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tinydfs_submit_create(tdfs, "/my_file_2", -1, false, 1024) < 0) {
|
if (mousefs_submit_create(mfs, "/my_file_2", -1, false, 1024) < 0) {
|
||||||
tinydfs_free(tdfs);
|
mousefs_free(mfs);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char buff_1[] = "This is file 1";
|
char buff_1[] = "This is file 1";
|
||||||
if (tinydfs_submit_write(tdfs, "/my_file_1", -1, 0, buff_1, sizeof(buff_1)-1) < 0) {
|
if (mousefs_submit_write(mfs, "/my_file_1", -1, 0, buff_1, sizeof(buff_1)-1) < 0) {
|
||||||
tinydfs_free(tdfs);
|
mousefs_free(mfs);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char buff_2[] = "This is file 2";
|
char buff_2[] = "This is file 2";
|
||||||
if (tinydfs_submit_write(tdfs, "/my_file_1", -1, 0, buff_2, sizeof(buff_2)-1) < 0) {
|
if (mousefs_submit_write(mfs, "/my_file_1", -1, 0, buff_2, sizeof(buff_2)-1) < 0) {
|
||||||
tinydfs_free(tdfs);
|
mousefs_free(mfs);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
TinyDFS_Result result;
|
MouseFS_Result result;
|
||||||
tinydfs_wait(tdfs, -1, &result, -1);
|
mousefs_wait(mfs, -1, &result, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
tinydfs_free(tdfs);
|
mousefs_free(mfs);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
#ifndef MOUSEFS_INCLUDED
|
||||||
|
#define MOUSEFS_INCLUDED
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <winsock2.h>
|
||||||
|
#else
|
||||||
|
#include <poll.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct MouseFS MouseFS;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
char name[128]; // TODO: Implement a proper name length
|
||||||
|
bool is_dir;
|
||||||
|
} MouseFS_Entity;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
MOUSEFS_RESULT_EMPTY,
|
||||||
|
MOUSEFS_RESULT_CREATE_ERROR,
|
||||||
|
MOUSEFS_RESULT_CREATE_SUCCESS,
|
||||||
|
MOUSEFS_RESULT_DELETE_ERROR,
|
||||||
|
MOUSEFS_RESULT_DELETE_SUCCESS,
|
||||||
|
MOUSEFS_RESULT_LIST_ERROR,
|
||||||
|
MOUSEFS_RESULT_LIST_SUCCESS,
|
||||||
|
MOUSEFS_RESULT_READ_ERROR,
|
||||||
|
MOUSEFS_RESULT_READ_SUCCESS,
|
||||||
|
MOUSEFS_RESULT_WRITE_ERROR,
|
||||||
|
MOUSEFS_RESULT_WRITE_SUCCESS,
|
||||||
|
} MouseFS_ResultType;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
|
||||||
|
MouseFS_ResultType type;
|
||||||
|
|
||||||
|
int num_entities;
|
||||||
|
MouseFS_Entity *entities;
|
||||||
|
} MouseFS_Result;
|
||||||
|
|
||||||
|
MouseFS *mousefs_init(char *addr, uint16_t port);
|
||||||
|
void mousefs_free(MouseFS *mfs);
|
||||||
|
void mousefs_wait(MouseFS *mfs, int opidx, MouseFS_Result *result, int timeout);
|
||||||
|
|
||||||
|
bool mousefs_isdone(MouseFS *mfs, int opidx, MouseFS_Result *result);
|
||||||
|
int mousefs_process_events(MouseFS *mfs, void **contexts, struct pollfd *polled, int num_polled);
|
||||||
|
|
||||||
|
int mousefs_submit_create (MouseFS *mfs, char *path, int path_len, bool is_dir, unsigned int chunk_size);
|
||||||
|
int mousefs_submit_delete (MouseFS *mfs, char *path, int path_len);
|
||||||
|
int mousefs_submit_list (MouseFS *mfs, char *path, int path_len);
|
||||||
|
int mousefs_submit_read (MouseFS *mfs, char *path, int path_len, int off, void *dst, int len);
|
||||||
|
int mousefs_submit_write (MouseFS *mfs, char *path, int path_len, int off, void *src, int len);
|
||||||
|
void mousefs_result_free(MouseFS_Result *result);
|
||||||
|
|
||||||
|
#endif // MOUSEFS_INCLUDED
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
#ifndef TINYDFS_INCLUDED
|
|
||||||
#define TINYDFS_INCLUDED
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <winsock2.h>
|
|
||||||
#else
|
|
||||||
#include <poll.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct TinyDFS TinyDFS;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char name[128]; // TODO: Implement a proper name length
|
|
||||||
bool is_dir;
|
|
||||||
} TinyDFS_Entity;
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
TINYDFS_RESULT_EMPTY,
|
|
||||||
TINYDFS_RESULT_CREATE_ERROR,
|
|
||||||
TINYDFS_RESULT_CREATE_SUCCESS,
|
|
||||||
TINYDFS_RESULT_DELETE_ERROR,
|
|
||||||
TINYDFS_RESULT_DELETE_SUCCESS,
|
|
||||||
TINYDFS_RESULT_LIST_ERROR,
|
|
||||||
TINYDFS_RESULT_LIST_SUCCESS,
|
|
||||||
TINYDFS_RESULT_READ_ERROR,
|
|
||||||
TINYDFS_RESULT_READ_SUCCESS,
|
|
||||||
TINYDFS_RESULT_WRITE_ERROR,
|
|
||||||
TINYDFS_RESULT_WRITE_SUCCESS,
|
|
||||||
} TinyDFS_ResultType;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
|
|
||||||
TinyDFS_ResultType type;
|
|
||||||
|
|
||||||
int num_entities;
|
|
||||||
TinyDFS_Entity *entities;
|
|
||||||
} TinyDFS_Result;
|
|
||||||
|
|
||||||
TinyDFS *tinydfs_init(char *addr, uint16_t port);
|
|
||||||
void tinydfs_free(TinyDFS *tdfs);
|
|
||||||
void tinydfs_wait(TinyDFS *tdfs, int opidx, TinyDFS_Result *result, int timeout);
|
|
||||||
|
|
||||||
bool tinydfs_isdone(TinyDFS *tdfs, int opidx, TinyDFS_Result *result);
|
|
||||||
int tinydfs_process_events(TinyDFS *tdfs, void **contexts, struct pollfd *polled, int num_polled);
|
|
||||||
|
|
||||||
int tinydfs_submit_create (TinyDFS *tdfs, char *path, int path_len, bool is_dir, unsigned int chunk_size);
|
|
||||||
int tinydfs_submit_delete (TinyDFS *tdfs, char *path, int path_len);
|
|
||||||
int tinydfs_submit_list (TinyDFS *tdfs, char *path, int path_len);
|
|
||||||
int tinydfs_submit_read (TinyDFS *tdfs, char *path, int path_len, int off, void *dst, int len);
|
|
||||||
int tinydfs_submit_write (TinyDFS *tdfs, char *path, int path_len, int off, void *src, int len);
|
|
||||||
void tinydfs_result_free(TinyDFS_Result *result);
|
|
||||||
|
|
||||||
#endif // TINYDFS_INCLUDED
|
|
||||||
+315
-315
File diff suppressed because it is too large
Load Diff
+29
-29
@@ -34,8 +34,8 @@ int simulation_client_init(SimulationClient *client, int argc, char **argv,
|
|||||||
uint16_t port;
|
uint16_t port;
|
||||||
parse_server_addr(argc, argv, &addr, &port);
|
parse_server_addr(argc, argv, &addr, &port);
|
||||||
|
|
||||||
client->tdfs = tinydfs_init(addr, port);
|
client->mfs = mousefs_init(addr, port);
|
||||||
if (client->tdfs == NULL)
|
if (client->mfs == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
client->num_pending = 0;
|
client->num_pending = 0;
|
||||||
@@ -43,7 +43,7 @@ int simulation_client_init(SimulationClient *client, int argc, char **argv,
|
|||||||
printf("Client set up (remote=%s:%d)\n", addr, port);
|
printf("Client set up (remote=%s:%d)\n", addr, port);
|
||||||
|
|
||||||
*timeout = 0;
|
*timeout = 0;
|
||||||
return tinydfs_process_events(client->tdfs, contexts, polled, 0);
|
return mousefs_process_events(client->mfs, contexts, polled, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int random_in_range(int min, int max)
|
static int random_in_range(int min, int max)
|
||||||
@@ -56,73 +56,73 @@ int simulation_client_step(SimulationClient *client, void **contexts,
|
|||||||
struct pollfd *polled, int num_polled, int *timeout)
|
struct pollfd *polled, int num_polled, int *timeout)
|
||||||
{
|
{
|
||||||
// Process any pending events from the network and get new poll descriptors
|
// Process any pending events from the network and get new poll descriptors
|
||||||
num_polled = tinydfs_process_events(client->tdfs, contexts, polled, num_polled);
|
num_polled = mousefs_process_events(client->mfs, contexts, polled, num_polled);
|
||||||
|
|
||||||
for (int i = 0; i < client->num_pending; i++) {
|
for (int i = 0; i < client->num_pending; i++) {
|
||||||
|
|
||||||
TinyDFS_Result result;
|
MouseFS_Result result;
|
||||||
if (!tinydfs_isdone(client->tdfs, client->pending[i].opidx, &result))
|
if (!mousefs_isdone(client->mfs, client->pending[i].opidx, &result))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
PendingOperation pending = client->pending[i];
|
PendingOperation pending = client->pending[i];
|
||||||
switch (result.type) {
|
switch (result.type) {
|
||||||
|
|
||||||
case TINYDFS_RESULT_EMPTY:
|
case MOUSEFS_RESULT_EMPTY:
|
||||||
assert(0);
|
assert(0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TINYDFS_RESULT_CREATE_ERROR:
|
case MOUSEFS_RESULT_CREATE_ERROR:
|
||||||
assert(pending.type == PENDING_OPERATION_CREATE);
|
assert(pending.type == PENDING_OPERATION_CREATE);
|
||||||
//printf("[Client] create error\n");
|
//printf("[Client] create error\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TINYDFS_RESULT_CREATE_SUCCESS:
|
case MOUSEFS_RESULT_CREATE_SUCCESS:
|
||||||
assert(pending.type == PENDING_OPERATION_CREATE);
|
assert(pending.type == PENDING_OPERATION_CREATE);
|
||||||
//printf("[Client] create success\n");
|
//printf("[Client] create success\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TINYDFS_RESULT_DELETE_ERROR:
|
case MOUSEFS_RESULT_DELETE_ERROR:
|
||||||
assert(pending.type == PENDING_OPERATION_DELETE);
|
assert(pending.type == PENDING_OPERATION_DELETE);
|
||||||
//printf("[Client] delete error\n");
|
//printf("[Client] delete error\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TINYDFS_RESULT_DELETE_SUCCESS:
|
case MOUSEFS_RESULT_DELETE_SUCCESS:
|
||||||
assert(pending.type == PENDING_OPERATION_DELETE);
|
assert(pending.type == PENDING_OPERATION_DELETE);
|
||||||
//printf("[Client] delete success\n");
|
//printf("[Client] delete success\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TINYDFS_RESULT_LIST_ERROR:
|
case MOUSEFS_RESULT_LIST_ERROR:
|
||||||
assert(pending.type == PENDING_OPERATION_LIST);
|
assert(pending.type == PENDING_OPERATION_LIST);
|
||||||
//printf("[Client] list error\n");
|
//printf("[Client] list error\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TINYDFS_RESULT_LIST_SUCCESS:
|
case MOUSEFS_RESULT_LIST_SUCCESS:
|
||||||
assert(pending.type == PENDING_OPERATION_LIST);
|
assert(pending.type == PENDING_OPERATION_LIST);
|
||||||
//printf("[Client] list success\n");
|
//printf("[Client] list success\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TINYDFS_RESULT_READ_ERROR:
|
case MOUSEFS_RESULT_READ_ERROR:
|
||||||
assert(pending.type == PENDING_OPERATION_READ);
|
assert(pending.type == PENDING_OPERATION_READ);
|
||||||
//printf("[Client] read error\n");
|
//printf("[Client] read error\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TINYDFS_RESULT_READ_SUCCESS:
|
case MOUSEFS_RESULT_READ_SUCCESS:
|
||||||
assert(pending.type == PENDING_OPERATION_READ);
|
assert(pending.type == PENDING_OPERATION_READ);
|
||||||
//printf("[Client] read success\n");
|
//printf("[Client] read success\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TINYDFS_RESULT_WRITE_ERROR:
|
case MOUSEFS_RESULT_WRITE_ERROR:
|
||||||
assert(pending.type == PENDING_OPERATION_WRITE);
|
assert(pending.type == PENDING_OPERATION_WRITE);
|
||||||
//printf("[Client] write error\n");
|
//printf("[Client] write error\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TINYDFS_RESULT_WRITE_SUCCESS:
|
case MOUSEFS_RESULT_WRITE_SUCCESS:
|
||||||
assert(pending.type == PENDING_OPERATION_WRITE);
|
assert(pending.type == PENDING_OPERATION_WRITE);
|
||||||
//printf("[Client] write success\n");
|
//printf("[Client] write success\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
free(pending.ptr);
|
free(pending.ptr);
|
||||||
tinydfs_result_free(&result);
|
mousefs_result_free(&result);
|
||||||
client->pending[i--] = client->pending[--client->num_pending];
|
client->pending[i--] = client->pending[--client->num_pending];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,8 +172,8 @@ int simulation_client_step(SimulationClient *client, void **contexts,
|
|||||||
case PENDING_OPERATION_CREATE:
|
case PENDING_OPERATION_CREATE:
|
||||||
entry = table[random_in_range(0, table_len-1)];
|
entry = table[random_in_range(0, table_len-1)];
|
||||||
chunk_size = entry.is_dir ? 0 : random_in_range(0, 5000);
|
chunk_size = entry.is_dir ? 0 : random_in_range(0, 5000);
|
||||||
ret = tinydfs_submit_create(
|
ret = mousefs_submit_create(
|
||||||
client->tdfs,
|
client->mfs,
|
||||||
entry.path,
|
entry.path,
|
||||||
-1,
|
-1,
|
||||||
entry.is_dir,
|
entry.is_dir,
|
||||||
@@ -184,8 +184,8 @@ int simulation_client_step(SimulationClient *client, void **contexts,
|
|||||||
|
|
||||||
case PENDING_OPERATION_DELETE:
|
case PENDING_OPERATION_DELETE:
|
||||||
entry = table[random_in_range(0, table_len-1)];
|
entry = table[random_in_range(0, table_len-1)];
|
||||||
ret = tinydfs_submit_delete(
|
ret = mousefs_submit_delete(
|
||||||
client->tdfs,
|
client->mfs,
|
||||||
entry.path,
|
entry.path,
|
||||||
-1
|
-1
|
||||||
);
|
);
|
||||||
@@ -194,8 +194,8 @@ int simulation_client_step(SimulationClient *client, void **contexts,
|
|||||||
|
|
||||||
case PENDING_OPERATION_LIST:
|
case PENDING_OPERATION_LIST:
|
||||||
entry = table[random_in_range(0, table_len-1)];
|
entry = table[random_in_range(0, table_len-1)];
|
||||||
ret = tinydfs_submit_list(
|
ret = mousefs_submit_list(
|
||||||
client->tdfs,
|
client->mfs,
|
||||||
entry.path,
|
entry.path,
|
||||||
-1
|
-1
|
||||||
);
|
);
|
||||||
@@ -208,7 +208,7 @@ int simulation_client_step(SimulationClient *client, void **contexts,
|
|||||||
len = random_in_range(0, 5000);
|
len = random_in_range(0, 5000);
|
||||||
ptr = malloc(len);
|
ptr = malloc(len);
|
||||||
if (ptr == NULL) assert(0);
|
if (ptr == NULL) assert(0);
|
||||||
ret = tinydfs_submit_read(client->tdfs,
|
ret = mousefs_submit_read(client->mfs,
|
||||||
entry.path,
|
entry.path,
|
||||||
-1,
|
-1,
|
||||||
off,
|
off,
|
||||||
@@ -225,8 +225,8 @@ int simulation_client_step(SimulationClient *client, void **contexts,
|
|||||||
ptr = malloc(len);
|
ptr = malloc(len);
|
||||||
if (ptr == NULL) assert(0);
|
if (ptr == NULL) assert(0);
|
||||||
memset(ptr, 'a', len);
|
memset(ptr, 'a', len);
|
||||||
ret = tinydfs_submit_write(
|
ret = mousefs_submit_write(
|
||||||
client->tdfs,
|
client->mfs,
|
||||||
entry.path,
|
entry.path,
|
||||||
-1,
|
-1,
|
||||||
off,
|
off,
|
||||||
@@ -250,12 +250,12 @@ int simulation_client_step(SimulationClient *client, void **contexts,
|
|||||||
*timeout = 10;
|
*timeout = 10;
|
||||||
else
|
else
|
||||||
*timeout = -1;
|
*timeout = -1;
|
||||||
return tinydfs_process_events(client->tdfs, contexts, polled, 0);
|
return mousefs_process_events(client->mfs, contexts, polled, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void simulation_client_free(SimulationClient *client)
|
void simulation_client_free(SimulationClient *client)
|
||||||
{
|
{
|
||||||
tinydfs_free(client->tdfs);
|
mousefs_free(client->mfs);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BUILD_TEST
|
#endif // BUILD_TEST
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "TinyDFS.h"
|
#include "MouseFS.h"
|
||||||
|
|
||||||
#define MAX_PENDING_OPERATION 8
|
#define MAX_PENDING_OPERATION 8
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ typedef struct {
|
|||||||
} PendingOperation;
|
} PendingOperation;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
TinyDFS *tdfs;
|
MouseFS *mfs;
|
||||||
int num_pending;
|
int num_pending;
|
||||||
PendingOperation pending[MAX_PENDING_OPERATION];
|
PendingOperation pending[MAX_PENDING_OPERATION];
|
||||||
} SimulationClient;
|
} SimulationClient;
|
||||||
|
|||||||
Reference in New Issue
Block a user