This commit is contained in:
Alex Young
2014-02-26 15:37:44 +00:00
6 changed files with 76 additions and 52 deletions

View File

@@ -636,7 +636,7 @@ static void mirror_read_cb( struct ev_loop *loop, ev_io *w, int revents )
return;
}
void mirror_timeout_cb( struct ev_loop *loop, ev_timer *w __attribute__((unused)), int revents )
static void mirror_timeout_cb( struct ev_loop *loop, ev_timer *w __attribute__((unused)), int revents )
{
if ( !(revents & EV_TIMER ) ) {
warn( "Mirror timeout called but no timer event signalled" );
@@ -648,7 +648,7 @@ void mirror_timeout_cb( struct ev_loop *loop, ev_timer *w __attribute__((unused)
return;
}
void mirror_abandon_cb( struct ev_loop *loop, ev_io *w, int revents )
static void mirror_abandon_cb( struct ev_loop *loop, ev_io *w, int revents )
{
struct mirror_ctrl* ctrl = (struct mirror_ctrl*) w->data;
NULLCHECK( ctrl );
@@ -666,7 +666,7 @@ void mirror_abandon_cb( struct ev_loop *loop, ev_io *w, int revents )
}
void mirror_limit_cb( struct ev_loop *loop, ev_timer *w, int revents )
static void mirror_limit_cb( struct ev_loop *loop, ev_timer *w, int revents )
{
struct mirror_ctrl* ctrl = (struct mirror_ctrl*) w->data;
NULLCHECK( ctrl );

View File

@@ -103,13 +103,11 @@ int socket_nbd_write_hello(int fd, off64_t out_size)
void fill_request(struct nbd_request *request, int type, off64_t from, int len)
{
int32_t handle_i[2];
handle_i[0] = rand();
handle_i[1] = rand();
request->magic = htobe32(REQUEST_MAGIC);
request->type = htobe32(type);
memcpy( request->handle, handle_i, sizeof(request->handle) );
uint32_t * randa = (uint32_t*)request->handle;
randa[0] = rand();
randa[1] = rand();
request->from = htobe64(from);
request->len = htobe32(len);
}

View File

@@ -116,6 +116,7 @@ uint64_t monotonic_time_ms(void);
#define fatal(msg, ...) do { \
myloglev(4, msg, ##__VA_ARGS__); \
error_handler(1); \
exit(1); /* never-reached, this is to make static code analizer happy */ \
} while(0)