summaryrefslogtreecommitdiffstats
path: root/src/server/globals.h
diff options
context:
space:
mode:
authorSimon Rettberg2015-12-15 17:45:44 +0100
committerSimon Rettberg2015-12-15 17:45:44 +0100
commit72104f2e83fa724f9667c876dca17a2c5ee9b2a2 (patch)
tree38837580c70b390f0bc35c15d2bc4d0865a9f3c4 /src/server/globals.h
parent[SERVER] Make listen port configurable (diff)
downloaddnbd3-72104f2e83fa724f9667c876dca17a2c5ee9b2a2.tar.gz
dnbd3-72104f2e83fa724f9667c876dca17a2c5ee9b2a2.tar.xz
dnbd3-72104f2e83fa724f9667c876dca17a2c5ee9b2a2.zip
[SERVER] Remove non-working images from list, plus refactoring
Now that we can automatically load unknown images from disk on request, it makes sense to remove non-working images from the image list. On future requests, we will look for them on disk again, which is nice in case of temporary storage hickups. Also, some more ore less related locking has been refined (loading images, replicating images)
Diffstat (limited to 'src/server/globals.h')
-rw-r--r--src/server/globals.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/server/globals.h b/src/server/globals.h
index 575f3ab..0bf34de 100644
--- a/src/server/globals.h
+++ b/src/server/globals.h
@@ -111,6 +111,7 @@ struct _dnbd3_image
int users; // clients currently using this image
int id; // Unique ID of this image. Only unique in the context of this running instance of DNBD3-Server
time_t atime; // last access time
+ time_t lastWorkCheck; // last time a non-working image has been checked
bool working; // true if image exists and completeness is == 100% or a working upstream proxy is connected
pthread_spinlock_t lock;
};
@@ -170,6 +171,11 @@ extern bool _isProxy;
extern bool _proxyPrivateOnly;
/**
+ * Whether to remove missing images from image list on SIGHUP
+ */
+extern bool _removeMissingImages;
+
+/**
* Read timeout when waiting for or sending data on an uplink
*/
extern int _uplinkTimeout;