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 | 7c80866b417ce602f6d1c188d18c28e8cf7e3a14 (patch) | |
tree | e2e97481771c0418713d67c6a53b6f1c53755354 /ufs | |
parent | 905a6f66bbdf18d967ab7e6b1de49763791ff87c (diff) |
* 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')
-rw-r--r-- | ufs/ChangeLog | 6 | ||||
-rw-r--r-- | ufs/inode.c | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/ufs/ChangeLog b/ufs/ChangeLog index d8e04a0e..8f651624 100644 --- a/ufs/ChangeLog +++ b/ufs/ChangeLog @@ -1,3 +1,9 @@ +2001-06-09 Mark Kettenis <kettenis@gnu.org> + + * 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. + 2001-01-08 Marcus Brinkmann <marcus@gnu.org> * main.c (main): Use %Ld instead %ld to print store->size. 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 (); |