Date: Tue, 6 May 2003 15:16:38 +0200 (CEST) From: Lukas Ertl <l.ertl@univie.ac.at> To: FreeBSD-gnats-submit@FreeBSD.org Subject: docs/51845: [PATCH] catch up getfsstat.2 and statfs.2 with reality Message-ID: <200305061316.h46DGcPt018633@korben.in.tern> Resent-Message-ID: <200305061320.h46DKDJh033270@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 51845 >Category: docs >Synopsis: [PATCH] catch up getfsstat.2 and statfs.2 with reality >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Tue May 06 06:20:13 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Lukas Ertl >Release: FreeBSD 5.1-BETA i386 >Organization: Vienna University Computer Center >Environment: System: FreeBSD korben 5.1-BETA FreeBSD 5.1-BETA #0: Tue May 6 12:01:11 CEST 2003 le@korben:/usr/obj/usr/src/sys/KORBEN i386 >Description: As already commented in sys/mount.h, getfsstat.2 and statfs.2 are out of sync with sys/mount.h. >How-To-Repeat: Compare sys/mount.h with getfsstat.2 and statfs.2. >Fix: --- mount.h.diff begins here --- Index: sys/sys/mount.h =================================================================== RCS file: /u/cvs/cvs/src/sys/sys/mount.h,v retrieving revision 1.147 diff -u -r1.147 mount.h --- sys/sys/mount.h 26 Mar 2003 22:15:58 -0000 1.147 +++ sys/sys/mount.h 6 May 2003 13:12:50 -0000 @@ -67,8 +67,6 @@ #define MFSNAMELEN 16 /* length of fs type name, including null */ #define MNAMELEN (88 - 2 * sizeof(long)) /* size of on/from name bufs */ -/* XXX getfsstat.2 is out of date with write and read counter changes here. */ -/* XXX statfs.2 is out of date with read counter changes here. */ struct statfs { long f_spare2; /* placeholder */ long f_bsize; /* fundamental filesystem block size */ Index: lib/libc/sys/getfsstat.2 =================================================================== RCS file: /u/cvs/cvs/src/lib/libc/sys/getfsstat.2,v retrieving revision 1.14 diff -u -r1.14 getfsstat.2 --- lib/libc/sys/getfsstat.2 19 Dec 2002 09:40:24 -0000 1.14 +++ lib/libc/sys/getfsstat.2 6 May 2003 13:12:50 -0000 @@ -65,25 +65,31 @@ */ #define MFSNAMELEN 16 /* length of fs type name, including null */ -#define MNAMELEN 90 /* length of buffer for returned name */ +#define MNAMELEN (88 - 2 * sizeof(long)) /* size of on/from name bufs */ struct statfs { - long f_spare2; /* placeholder */ - long f_bsize; /* fundamental file system block size */ - long f_iosize; /* optimal transfer block size */ - long f_blocks; /* total data blocks in file system */ - long f_bfree; /* free blocks in fs */ - long f_bavail; /* free blocks avail to non-superuser */ - long f_files; /* total file nodes in file system */ - long f_ffree; /* free file nodes in fs */ - fsid_t f_fsid; /* file system id */ - uid_t f_owner; /* user that mounted the file system */ - int f_type; /* type of file system (see below) */ - int f_flags; /* copy of mount flags */ - long f_spare[2]; /* spare for later */ - char f_fstypename[MFSNAMELEN];/* fs type name */ - char f_mntonname[MNAMELEN];/* directory on which mounted */ - char f_mntfromname[MNAMELEN];/* mounted file system */ + long f_spare2; /* placeholder */ + long f_bsize; /* fundamental file system block size */ + long f_iosize; /* optimal transfer block size */ + long f_blocks; /* total data blocks in file system */ + long f_bfree; /* free blocks in fs */ + long f_bavail; /* free blocks avail to non-superuser */ + long f_files; /* total file nodes in file system */ + long f_ffree; /* free file nodes in fs */ + fsid_t f_fsid; /* file system id */ + uid_t f_owner; /* user that mounted the file system */ + int f_type; /* type of file system (see below) */ + int f_flags; /* copy of mount exported flags */ + long f_syncwrites; /* count of sync writes since mount */ + long f_asyncwrites; /* count of async writes since mount */ + char f_fstypename[MFSNAMELEN];/* fs type name */ + char f_mntonname[MNAMELEN];/* directory on which mounted */ + long f_syncreads; /* count of sync reads since mount */ + long f_asyncreads; /* count of async reads since mount */ + short f_spares1; /* unused spare */ + char f_mntfromname[MNAMELEN];/* mounted filesystem */ + short f_spares2; /* unused spare */ + long f_spare[2]; /* unused spare */ }; .Ed .Pp Index: lib/libc/sys/statfs.2 =================================================================== RCS file: /u/cvs/cvs/src/lib/libc/sys/statfs.2,v retrieving revision 1.21 diff -u -r1.21 statfs.2 --- lib/libc/sys/statfs.2 19 Dec 2002 09:40:25 -0000 1.21 +++ lib/libc/sys/statfs.2 6 May 2003 13:12:50 -0000 @@ -70,27 +70,31 @@ */ #define MFSNAMELEN 16 /* length of fs type name, including null */ -#define MNAMELEN 90 /* length of buffer for returned name */ +#define MNAMELEN (88 - 2 * sizeof(long)) /* size of on/from name bufs */ struct statfs { -long f_bsize; /* fundamental file system block size */ -long f_iosize; /* optimal transfer block size */ -long f_blocks; /* total data blocks in file system */ -long f_bfree; /* free blocks in fs */ -long f_bavail; /* free blocks avail to non-superuser */ -long f_files; /* total file nodes in file system */ -long f_ffree; /* free file nodes in fs */ -fsid_t f_fsid; /* file system id */ -uid_t f_owner; /* user that mounted the file system */ -int f_type; /* type of file system */ -int f_flags; /* copy of mount flags */ -long f_syncwrites; /* count of sync writes since mount */ -long f_asyncwrites; /* count of async writes since mount */ -char f_fstypename[MFSNAMELEN];/* fs type name */ -char f_mntonname[MNAMELEN]; /* mount point */ -long f_syncreads; /* count of sync reads since mount */ -long f_asyncreads; /* count of async reads since mount */ -char f_mntfromname[MNAMELEN]; /* mounted file system */ + long f_spare2; /* placeholder */ + long f_bsize; /* fundamental file system block size */ + long f_iosize; /* optimal transfer block size */ + long f_blocks; /* total data blocks in file system */ + long f_bfree; /* free blocks in fs */ + long f_bavail; /* free blocks avail to non-superuser */ + long f_files; /* total file nodes in file system */ + long f_ffree; /* free file nodes in fs */ + fsid_t f_fsid; /* file system id */ + uid_t f_owner; /* user that mounted the file system */ + int f_type; /* type of file system (see below) */ + int f_flags; /* copy of mount exported flags */ + long f_syncwrites; /* count of sync writes since mount */ + long f_asyncwrites; /* count of async writes since mount */ + char f_fstypename[MFSNAMELEN];/* fs type name */ + char f_mntonname[MNAMELEN];/* directory on which mounted */ + long f_syncreads; /* count of sync reads since mount */ + long f_asyncreads; /* count of async reads since mount */ + short f_spares1; /* unused spare */ + char f_mntfromname[MNAMELEN];/* mounted filesystem */ + short f_spares2; /* unused spare */ + long f_spare[2]; /* unused spare */ }; .Ed The flags that may be returned include: --- mount.h.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305061316.h46DGcPt018633>