-
- if(est(dp)->level[0] != -1 && est(dp)->est_size[0] < (off_t)0) {
- if(est(dp)->est_size[0] == (off_t)-1) {
- log_add(L_WARNING, "disk %s:%s, estimate of level %d failed.",
- dp->host->hostname, qname, est(dp)->level[0]);
- }
- else {
- log_add(L_WARNING,
- "disk %s:%s, estimate of level %d timed out.",
- dp->host->hostname, qname, est(dp)->level[0]);
- }
- est(dp)->level[0] = -1;
- }
-
- if(est(dp)->level[1] != -1 && est(dp)->est_size[1] < (off_t)0) {
- if(est(dp)->est_size[1] == (off_t)-1) {
- log_add(L_WARNING,
- "disk %s:%s, estimate of level %d failed.",
- dp->host->hostname, qname, est(dp)->level[1]);
- }
- else {
- log_add(L_WARNING,
- "disk %s:%s, estimate of level %d timed out.",
- dp->host->hostname, qname, est(dp)->level[1]);
- }
- est(dp)->level[1] = -1;
- }
-
- if(est(dp)->level[2] != -1 && est(dp)->est_size[2] < (off_t)0) {
- if(est(dp)->est_size[2] == (off_t)-1) {
- log_add(L_WARNING,
- "disk %s:%s, estimate of level %d failed.",
- dp->host->hostname, qname, est(dp)->level[2]);
- }
- else {
- log_add(L_WARNING,
- "disk %s:%s, estimate of level %d timed out.",
- dp->host->hostname, qname, est(dp)->level[2]);
- }
- est(dp)->level[2] = -1;
- }
-
- if((est(dp)->level[0] != -1 && est(dp)->est_size[0] > (off_t)0) ||
- (est(dp)->level[1] != -1 && est(dp)->est_size[1] > (off_t)0) ||
- (est(dp)->level[2] != -1 && est(dp)->est_size[2] > (off_t)0)) {
+ int i;
+
+ for (i=0; i < MAX_LEVELS; i++) {
+ if (est(dp)->estimate[i].level != -1 &&
+ est(dp)->estimate[i].nsize < (gint64)0) {
+ if (est(dp)->estimate[i].nsize == (gint64)-3) {
+ log_add(L_WARNING,
+ _("disk %s:%s, estimate of level %d timed out."),
+ dp->host->hostname, qname, est(dp)->estimate[i].level);
+ }
+ est(dp)->estimate[i].level = -1;
+ }
+ }
+
+ if ((est(dp)->estimate[0].level != -1 &&
+ est(dp)->estimate[0].nsize > (gint64)0) ||
+ (est(dp)->estimate[1].level != -1 &&
+ est(dp)->estimate[1].nsize > (gint64)0) ||
+ (est(dp)->estimate[2].level != -1 &&
+ est(dp)->estimate[2].nsize > (gint64)0)) {