The volume header has a field called "filecount", updated upon salvage, and henceforth forgotten.

The attached patch maintains that count (which for existing volumes is obviously wrong until the next salvage, but care is taken not to underflow). The only way to display it is through 'volinfo' (which means the information is out-of-date until the fileserver flushes the header), but I'm sure some motivated soul can eventually cram this into 'vos examine' or thereabouts.

The field is useful as it is the number 1 parameter governing the time it takes for a 'vos backup', 'release' or a salvage.

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rainer Toebbicke
European Laboratory for Particle Physics(CERN) - Geneva, Switzerland
Phone: +41 22 767 8985       Fax: +41 22 767 7155
*** openafs/src/vol/vnode.c.orig        2004-08-25 09:14:19.000000000 +0200
--- openafs/src/vol/vnode.c     2004-11-19 17:34:40.000000000 +0100
***************
*** 428,433 ****
--- 428,434 ----
      vnp->disk.uniquifier = unique;
      vnp->handle = NULL;
      vcp->allocs++;
+     vp->header->diskstuff.filecount++;
      return vnp;
  }
  
***************
*** 760,765 ****
--- 761,767 ----
                 * (doing so could cause a "addled bitmap" message).
                 */
                if (vnp->delete && !*ec) {
+                   if (vnp->volumePtr->header->diskstuff.filecount-- < 1) 
vnp->volumePtr->header->diskstuff.filecount=0;
                    VFreeBitMapEntry_r(ec, &vp->vnodeIndex[class],
                                       vnodeIdToBitNumber(vnp->vnodeNumber));
                }

Reply via email to