[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r2261 - GNUnet/src/applications/datastore
From: |
grothoff |
Subject: |
[GNUnet-SVN] r2261 - GNUnet/src/applications/datastore |
Date: |
Sat, 19 Nov 2005 09:08:46 -0800 (PST) |
Author: grothoff
Date: 2005-11-19 09:08:44 -0800 (Sat, 19 Nov 2005)
New Revision: 2261
Modified:
GNUnet/src/applications/datastore/datastore.c
Log:
fixing bug 977 (by eliminating the only periodic call to gCI)
Modified: GNUnet/src/applications/datastore/datastore.c
===================================================================
--- GNUnet/src/applications/datastore/datastore.c 2005-11-19 10:43:36 UTC
(rev 2260)
+++ GNUnet/src/applications/datastore/datastore.c 2005-11-19 17:08:44 UTC
(rev 2261)
@@ -63,7 +63,12 @@
static long long available;
/**
+ * Quota from config file.
*/
+static unsigned long long quota;
+
+/**
+ */
static unsigned long long getSize() {
return sq->getSize();
}
@@ -283,9 +288,7 @@
* Also updates available and minPriority.
*/
static void cronMaintenance(void * unused) {
- long long tmpAvailable
- = getConfigurationInt("FS", "QUOTA") * 1024 * 1024; /* MB to bytes */
- available = tmpAvailable - sq->getSize();
+ available = quota - sq->getSize();
if (available < MIN_FREE) {
sq->iterateExpirationTime(ANY_BLOCK,
&freeSpaceExpired,
@@ -306,17 +309,20 @@
Datastore_ServiceAPI *
provide_module_datastore(CoreAPIForApplication * capi) {
static Datastore_ServiceAPI api;
- int quota;
+ unsigned int lquota;
+ lquota
+ = getConfigurationInt("FS", "QUOTA");
+ quota
+ = lquota * 1024 * 1024; /* MB to bytes */
sq = capi->requestService("sqstore");
if (sq == NULL) {
BREAK();
return NULL;
}
- quota
- = htonl(getConfigurationInt("FS", "QUOTA"));
+ lquota = htonl(lquota);
stateWriteContent("FS-LAST-QUOTA",
- sizeof(int),
+ sizeof(unsigned int),
"a);
coreAPI = capi;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r2261 - GNUnet/src/applications/datastore,
grothoff <=