/*
- * $Id: diskd.cc,v 1.5 2000/06/26 20:17:12 adrian Exp $
+ * $Id: diskd.cc,v 1.6 2000/10/03 15:31:40 wessels Exp $
*
* DEBUG: section -- External DISKD process implementation.
* AUTHOR: Harvest Derived
do_unlink(diomsg * r, int len, const char *buf)
{
#if USE_TRUNCATE
- if (truncate(buf, 0) < 0) {
+ if (truncate(buf, 0) < 0)
#else
- if (unlink(buf) < 0) {
+ if (unlink(buf) < 0)
#endif
+ {
fprintf(stderr, "%d UNLNK id %d %s: ", (int) mypid, r->id, buf);
perror("truncate");
return -errno;
/*
- * $Id: store_dir_diskd.cc,v 1.16 2000/07/16 07:28:38 wessels Exp $
+ * $Id: store_dir_diskd.cc,v 1.17 2000/10/03 15:31:40 wessels Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
if (store_dirs_rebuilding) {
return;
} else {
- /* XXX FixMe: This should use the cache_dir hig/low values, not the
- * global ones
- */
- f = (double) (store_swap_size - store_swap_low) / (store_swap_high - store_swap_low);
+ f = (double) (SD->cur_size - SD->low_size) / (SD->max_size - SD->low_size);
f = f < 0.0 ? 0.0 : f > 1.0 ? 1.0 : f;
max_scan = (int) (f * 400.0 + 100.0);
max_remove = (int) (f * 70.0 + 10.0);
debug(20, 3) ("storeMaintainSwapSpace: f=%f, max_scan=%d, max_remove=%d\n", f, max_scan, max_remove);
walker = SD->repl->PurgeInit(SD->repl, max_scan);
while (1) {
- /* XXX FixMe: This should use the cache_dir hig/low values, not the
- * global ones
- */
- if (store_swap_size < store_swap_low)
+ if (SD->cur_size < SD->low_size)
break;
if (removed >= max_remove)
break;