Coda File System

Partition sizes

From: <m9111_at_abc.se>
Date: Sun, 30 Apr 2000 23:16:23 +0000 (GMT)
What are the "blocks" that Coda shows in "cfs lv"?  If they are 1K
blocks, then the count is wrong, since Coda forgets to take into
account that block sizes on partitions can vary.

Anyway, makeftree gives the partition size as if the blocks were
always 1K.

If this is a bug, then the following patch fixes it if
HAVE_SYS_STATVFS, and the other case has to be modified in a similar
way.



--- coda-src/partition/partition.c.orig Mon May  1 00:27:40 2000
+++ coda-src/partition/partition.c      Mon May  1 00:32:49 2000
@@ -204,6 +204,7 @@
     struct statvfs vfsbuf;
     int rc;
     int reserved_blocks;
+    unsigned long bsiz;
 
     rc = statvfs(dp->name, &vfsbuf);
     if ( rc != 0 ) {
@@ -212,9 +213,10 @@
        CODA_ASSERT( 0 );
     }
 
-    reserved_blocks = vfsbuf.f_bfree-vfsbuf.f_bavail; /* reserved for s-user */
-    dp->free = vfsbuf.f_bavail;  /* free blocks for non s-users */
-    dp->totalUsable = vfsbuf.f_blocks - reserved_blocks;
+    bsiz = vfsbuf.f_bsize/1024;
+    reserved_blocks = (vfsbuf.f_bfree-vfsbuf.f_bavail)*bsiz; /* reserved for s-user */
+    dp->free = vfsbuf.f_bavail*bsiz;  /* free blocks for non s-users */
+    dp->totalUsable = vfsbuf.f_blocks*bsiz - reserved_blocks;
     dp->minFree = 100 * reserved_blocks / vfsbuf.f_blocks;
 
 #elif defined(HAVE_STATFS)
Received on 2000-04-30 19:48:32