diff options
author | Simon Rettberg | 2020-03-06 11:34:58 +0100 |
---|---|---|
committer | Simon Rettberg | 2020-03-06 11:48:39 +0100 |
commit | 080a06ab22c8ac0841c06fe52ab4dbc982beafc1 (patch) | |
tree | b33de9bc1cb0c974810dc187918eb5a1cfca0165 /src/server/globals.h | |
parent | [SERVER] Add timer task for saving cache maps (diff) | |
download | dnbd3-080a06ab22c8ac0841c06fe52ab4dbc982beafc1.tar.gz dnbd3-080a06ab22c8ac0841c06fe52ab4dbc982beafc1.tar.xz dnbd3-080a06ab22c8ac0841c06fe52ab4dbc982beafc1.zip |
[SERVER] Reload cache maps periodically for local images
If an image is incomplete, but has no upstream server that can be used
for replication, reload the cache map from disk periodically, in case
some other server instance is writing to the image.
Diffstat (limited to 'src/server/globals.h')
-rw-r--r-- | src/server/globals.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/globals.h b/src/server/globals.h index 10d3ee3..211fe2d 100644 --- a/src/server/globals.h +++ b/src/server/globals.h @@ -111,6 +111,8 @@ typedef struct typedef struct { ref reference; + atomic_bool dirty; // Cache map has been modified outside uplink (only integrity checker for now) + bool unchanged; // How many times in a row a reloaded cache map went unchanged _Atomic uint8_t map[]; } dnbd3_cache_map_t; @@ -144,7 +146,6 @@ struct _dnbd3_image atomic_bool queue; // Too many requests waiting on uplink } problem; uint16_t rid; // revision of image - atomic_bool mapDirty; // Cache map has been modified outside uplink (only integrity checker for now) pthread_mutex_t lock; }; |