From 053ca3b9a9601467d5ce30c56c3cea078c897f57 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 4 Jul 2018 14:39:43 +0200 Subject: [SERVER] Refactor uplink/cache handling, improve crc checking The cacheFd is now moved to the uplink data structure and will only be handled by the uplink thread. The integrity checker now supports checking all blocks of an image. This will be triggered automatically whenever a check for a single block failed. Also, if a crc check on startup fails, the image won't be discarded anymore, but rather a full check will be initiated. Furthermore, when calling image_updateCacheMap() on an image that was previously complete, the cache map will now be re-initialized, and a new uplink connection created. --- src/shared/fdsignal.inc/eventfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/shared') diff --git a/src/shared/fdsignal.inc/eventfd.c b/src/shared/fdsignal.inc/eventfd.c index b4d4d6e..358d41c 100644 --- a/src/shared/fdsignal.inc/eventfd.c +++ b/src/shared/fdsignal.inc/eventfd.c @@ -27,7 +27,7 @@ dnbd3_signal_t* signal_newBlocking() int signal_call(const dnbd3_signal_t* const signal) { if ( signal == NULL ) return SIGNAL_ERROR; - static uint64_t one = 1; + static const uint64_t one = 1; const int signalFd = ( (int)(intptr_t)signal ) - 1; return write( signalFd, &one, sizeof one ) == sizeof one ? SIGNAL_OK : SIGNAL_ERROR; } -- cgit v1.2.3-55-g7522