summaryrefslogtreecommitdiff
path: root/bin/df
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2007-03-19 13:27:48 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2007-03-19 13:27:48 +0000
commit8aee7db6c25d6479509af36b682b28c5e51add21 (patch)
tree8aa84069967cc178e9c2feece75ade70fdc160f4 /bin/df
parentaf8c22017b5c85a3079120a0f1984f96424c04f8 (diff)
Add FFS2 fields to the superblock, change file system tools to keep
accessing FFS1 fields, okay art@, quite some testing by ckuethe@, simon@ and thib@, thanks.
Diffstat (limited to 'bin/df')
-rw-r--r--bin/df/ffs_df.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/df/ffs_df.c b/bin/df/ffs_df.c
index f510a4c5287..7157e85ad53 100644
--- a/bin/df/ffs_df.c
+++ b/bin/df/ffs_df.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_df.c,v 1.10 2004/09/14 22:46:04 deraadt Exp $ */
+/* $OpenBSD: ffs_df.c,v 1.11 2007/03/19 13:27:47 pedro Exp $ */
/*
* Copyright (c) 1980, 1990, 1993, 1994
@@ -75,13 +75,13 @@ ffs_df(int rfd, char *file, struct statfs *sfsp)
sfsp->f_flags = 0;
sfsp->f_bsize = sblock.fs_fsize;
sfsp->f_iosize = sblock.fs_bsize;
- sfsp->f_blocks = sblock.fs_dsize;
- sfsp->f_bfree = sblock.fs_cstotal.cs_nbfree * sblock.fs_frag +
- sblock.fs_cstotal.cs_nffree;
- sfsp->f_bavail = ((int64_t)sblock.fs_dsize * (100 -
- sblock.fs_minfree) / 100) - (sblock.fs_dsize - sfsp->f_bfree);
+ sfsp->f_blocks = sblock.fs_ffs1_dsize;
+ sfsp->f_bfree = sblock.fs_ffs1_cstotal.cs_nbfree * sblock.fs_frag +
+ sblock.fs_ffs1_cstotal.cs_nffree;
+ sfsp->f_bavail = ((int64_t)sblock.fs_ffs1_dsize * (100 -
+ sblock.fs_minfree) / 100) - (sblock.fs_ffs1_dsize - sfsp->f_bfree);
sfsp->f_files = sblock.fs_ncg * sblock.fs_ipg - ROOTINO;
- sfsp->f_ffree = sblock.fs_cstotal.cs_nifree;
+ sfsp->f_ffree = sblock.fs_ffs1_cstotal.cs_nifree;
sfsp->f_fsid.val[0] = 0;
sfsp->f_fsid.val[1] = 0;
if ((mntpt = getmntpt(file)) == 0)