Split client-specific code into client.{c,h}

This commit is contained in:
Alex Young
2012-06-06 11:27:52 +01:00
parent d22471d195
commit 40279bc9ca
4 changed files with 415 additions and 388 deletions

View File

@@ -11,6 +11,8 @@
#include <sys/types.h>
static const int block_allocation_resolution = 4096;//128<<10;
enum mirror_finish_action {
ACTION_PROXY,
ACTION_EXIT,
@@ -80,6 +82,10 @@ struct server {
nbd_client[MAX_NBD_CLIENTS];
};
int server_detect_closed(struct server* serve);
void server_dirty(struct server *serve, off64_t from, int len);
struct mode_readwrite_params {
union mysockaddr connect_to;
off64_t from;
@@ -88,14 +94,6 @@ struct mode_readwrite_params {
int client;
};
struct client_params {
int socket;
int fileno;
char* mapped;
struct server* serve; /* FIXME: remove above duplication */
};
#endif