maintain-volume-filecounts-20050424
authorRainer Toebbicke <rtb@pclella.cern.ch>
Sun, 24 Apr 2005 15:19:55 +0000 (15:19 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 24 Apr 2005 15:19:55 +0000 (15:19 +0000)
maintain file counts in volume header

src/vol/vnode.c

index 51568e1..ac922b5 100644 (file)
@@ -428,6 +428,7 @@ VAllocVnode_r(Error * ec, Volume * vp, VnodeType type)
     vnp->disk.uniquifier = unique;
     vnp->handle = NULL;
     vcp->allocs++;
+    vp->header->diskstuff.filecount++;
     return vnp;
 }
 
@@ -760,6 +761,8 @@ VPutVnode_r(Error * ec, register Vnode * vnp)
                 * (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));
                }