From c9727a2f41adfd80a8e92a98e29eb314e6ef5fb9 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Thu, 2 Nov 2000 04:48:16 +0000 Subject: [PATCH] DW: - replacement should use SwapDir high/low values, not the global ones. Made this patch for diskd some time ago, but never duplicated the patch in all the other fs duplicated code. --- src/fs/aufs/store_dir_aufs.cc | 10 ++-------- src/fs/ufs/store_dir_ufs.cc | 12 +++--------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/fs/aufs/store_dir_aufs.cc b/src/fs/aufs/store_dir_aufs.cc index 0a63ce2846..5c9e5a0b1a 100644 --- a/src/fs/aufs/store_dir_aufs.cc +++ b/src/fs/aufs/store_dir_aufs.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_aufs.cc,v 1.12 2000/11/01 03:35:47 wessels Exp $ + * $Id: store_dir_aufs.cc,v 1.13 2000/11/01 21:48:16 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -1307,9 +1307,6 @@ storeAufsDirMaintain(SwapDir * SD) 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 = f < 0.0 ? 0.0 : f > 1.0 ? 1.0 : f; max_scan = (int) (f * 400.0 + 100.0); @@ -1322,10 +1319,7 @@ storeAufsDirMaintain(SwapDir * SD) 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; diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index 9d64aa172f..e6b7395ace 100644 --- a/src/fs/ufs/store_dir_ufs.cc +++ b/src/fs/ufs/store_dir_ufs.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.cc,v 1.12 2000/11/01 03:35:49 wessels Exp $ + * $Id: store_dir_ufs.cc,v 1.13 2000/11/01 21:48:18 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -1305,10 +1305,7 @@ storeUfsDirMaintain(SwapDir * SD) 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); @@ -1319,10 +1316,7 @@ storeUfsDirMaintain(SwapDir * SD) 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; -- 2.47.3