diff options
author | Simon Rettberg | 2020-03-13 16:03:29 +0100 |
---|---|---|
committer | Simon Rettberg | 2020-03-13 16:03:29 +0100 |
commit | 290d3478f245bb7d2112bb781286a9fbae42b983 (patch) | |
tree | 3cc825ae2249126d1f97f4e06592358ab9cfd81a /src/server/globals.c | |
parent | [SERVER] Fix data type (diff) | |
download | dnbd3-290d3478f245bb7d2112bb781286a9fbae42b983.tar.gz dnbd3-290d3478f245bb7d2112bb781286a9fbae42b983.tar.xz dnbd3-290d3478f245bb7d2112bb781286a9fbae42b983.zip |
[SERVER] Rewrite uplink queue handling
- Now uses linked lists instead of huge array
- Does prefetch data on client requests
- Can have multiple replication requests in-flight
Diffstat (limited to 'src/server/globals.c')
-rw-r--r-- | src/server/globals.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/server/globals.c b/src/server/globals.c index ac079b1..98e0ddb 100644 --- a/src/server/globals.c +++ b/src/server/globals.c @@ -19,6 +19,7 @@ atomic_int _clientPenalty = 0; atomic_bool _isProxy = false; atomic_int _backgroundReplication = BGR_FULL; atomic_int _bgrMinClients = 0; +atomic_int _bgrWindowSize = 1; atomic_bool _lookupMissingForProxy = true; atomic_bool _sparseFiles = false; atomic_bool _ignoreAllocErrors = false; @@ -74,6 +75,7 @@ static int ini_handler(void *custom UNUSED, const char* section, const char* key SAVE_TO_VAR_BOOL( dnbd3, isProxy ); SAVE_TO_VAR_BOOL( dnbd3, proxyPrivateOnly ); SAVE_TO_VAR_INT( dnbd3, bgrMinClients ); + SAVE_TO_VAR_INT( dnbd3, bgrWindowSize ); SAVE_TO_VAR_BOOL( dnbd3, lookupMissingForProxy ); SAVE_TO_VAR_BOOL( dnbd3, sparseFiles ); SAVE_TO_VAR_BOOL( dnbd3, ignoreAllocErrors ); @@ -134,6 +136,9 @@ void globals_loadConfig() logadd( LOG_WARNING, "Ignoring 'sparseFiles=true' since backgroundReplication is set to true and bgrMinClients is too low" ); _sparseFiles = false; } + if ( _bgrWindowSize < 1 ) { + _bgrWindowSize = 1; + } // Dump config as interpreted char buffer[2000]; globals_dumpConfig( buffer, sizeof(buffer) ); @@ -325,6 +330,7 @@ size_t globals_dumpConfig(char *buffer, size_t size) PBOOL(backgroundReplication); } PINT(bgrMinClients); + PINT(bgrWindowSize); PBOOL(lookupMissingForProxy); PBOOL(sparseFiles); PBOOL(ignoreAllocErrors); |