Subject: Re: Problem with df(1)
To: 'port-i386@netbsd.org' <port-i386@NetBSD.ORG>
From: Gunnar Helliesen <gunnar@bitcon.no>
List: port-i386
Date: 11/06/1997 14:43:13
I finally found where the filesys statistics were actually calculated
(/sys/ufs/ffs/ffs_vfsops.c) and saw that the code had changed from 1.2G
to -current:


(1.2G:)
  sbp->f_bavail =3D (fs->fs_dsize * (100 - fs->fs_minfree) / 100) -
          (fs->fs_dsize - sbp->f_bfree);

(1.3A:)
  sbp->f_bavail =3D (long) (((u_int64_t) fs->fs_dsize * (u_int64_t)
          (100 - fs->fs_minfree) / (u_int64_t) 100) -
          (u_int64_t) (fs->fs_dsize - sbp->f_bfree));


I applied these changes to my 1.2G kernel source, recompiled and voila:


atlas:~# df /dev/sd2c
Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
/dev/sd2c    21952751 21150020   802731    96%    /usr/local/ftp/.4


Thanks to Jason, Perry, greywolf, Jukka and H=E5vard!

Gunnar

--
Gunnar Helliesen   | Bergen IT Consult AS  | NetBSD/VAX on a uVAX II
Systems Consultant | Bergen, Norway        | '86 Jaguar Sovereign 4.2
gunnar@bitcon.no   | http://www.bitcon.no/ | '73 Mercedes 280 (240D)