diff options
author | Mark Kettenis <kettenis@gnu.org> | 2001-06-09 20:30:34 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2001-06-09 20:30:34 +0000 |
commit | 534df041169b945cceb710cdef4a9039ed2d20d4 (patch) | |
tree | 8af2711fa9716a6218a30e11fc69f30cb2392578 /ufs/inode.c | |
parent | 4643b2070c54a9888f9fa4bf0c951274d2d3d6fe (diff) | |
download | hurd-534df041169b945cceb710cdef4a9039ed2d20d4.tar.gz hurd-534df041169b945cceb710cdef4a9039ed2d20d4.tar.bz2 hurd-534df041169b945cceb710cdef4a9039ed2d20d4.zip |
* inode.c (diskfs_set_statfs): If number of free blocks is less
than the number of reserved blocks, set the number of available
blocks to 0.
Diffstat (limited to 'ufs/inode.c')
-rw-r--r-- | ufs/inode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ufs/inode.c b/ufs/inode.c index 72467e1a..2647754c 100644 --- a/ufs/inode.c +++ b/ufs/inode.c @@ -1,5 +1,5 @@ /* Inode management routines - Copyright (C) 1994,95,96,97,98,2000 Free Software Foundation, Inc. + Copyright (C) 1994,95,96,97,98,2000,01 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -519,6 +519,8 @@ diskfs_set_statfs (struct statfs *st) + sblock->fs_cstotal.cs_nffree); st->f_bavail = ((sblock->fs_dsize * (100 - sblock->fs_minfree) / 100) - (sblock->fs_dsize - st->f_bfree)); + if (st->f_bfree < ((sblock->fs_dsize * (100 - sblock->fs_minfree) / 100))) + st->f_bavail = 0; st->f_files = sblock->fs_ncg * sblock->fs_ipg - 2; /* not 0 or 1 */ st->f_ffree = sblock->fs_cstotal.cs_nifree; st->f_fsid = getpid (); |