Re: NNTPC: Expire - weird behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"minBlocksFreePercent" should be called "maxBlocksUsedPercent", with
the current implementation. Idem for "minFilesFreePercent".



Patch for 2.4.0b2:

Index: expire.c
===================================================================
RCS file: /opt/src/cvsroot/nntpcache/src/expire.c,v
retrieving revision 1.7
retrieving revision 1.9
diff -c -r1.7 -r1.9
*** expire.c    2000/01/05 19:23:44     1.7
--- expire.c    2000/01/05 20:25:23     1.9
***************
*** 176,183 ****
      #define IU ((files - ffree) / (.01 * files ))
      /* logen (("bu = %2.1f, iu = %2.1f", BU, IU)); */
  
!     if (!(force || BU > con->minBlocksFreePercent || IU > con->minFilesFreePercent))
        return FALSE;
      ti = time (NULL);
      OldestArt = ti - con->maxArtAge;
      if (Task->ti_state == nc_master)
--- 176,184 ----
      #define IU ((files - ffree) / (.01 * files ))
      /* logen (("bu = %2.1f, iu = %2.1f", BU, IU)); */
  
!     if((!force) && (BU + con->minBlocksFreePercent < 100) && (IU + con->minFilesFreePercent < 100))
        return FALSE;
+ 
      ti = time (NULL);
      OldestArt = ti - con->maxArtAge;
      if (Task->ti_state == nc_master)
***************
*** 199,206 ****
  
                                    expire_arts (NULL, 0);
                                    getFreeFS(&ffree, &files, &bavail, &blocks);
!                                   while ((BU > con->minBlocksFreePercent ||
!                                           IU > con->minFilesFreePercent) &&
                                           maxArtAge > 60)
                                        {
                                            maxArtAge = maxArtAge * 2 / 3;
--- 200,207 ----
  
                                    expire_arts (NULL, 0);
                                    getFreeFS(&ffree, &files, &bavail, &blocks);
!                                   while (((BU + con->minBlocksFreePercent > 100) ||
!                                           (IU + con->minFilesFreePercent > 100)) &&
                                           maxArtAge > 60)
                                        {
                                            maxArtAge = maxArtAge * 2 / 3;


-- 
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea@argo.es http://www.argo.es/~jcea/ _/_/    _/_/  _/_/    _/_/  _/_/
                                      _/_/    _/_/          _/_/_/_/_/
PGP Key Available at KeyServ   _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz


[Index of Archives]     [Yosemite]     [Yosemite Campsites]     [Bugtraq]     [Linux]     [Trn]

Powered by Linux