[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
new struct statfs changed committed
- To: announce_(_at_)_openbsd_(_dot_)_org
- Subject: new struct statfs changed committed
- From: "Todd C. Miller" <Todd_(_dot_)_Miller_(_at_)_courtesan_(_dot_)_com>
- Date: Mon, 31 May 1999 12:31:00 -0600
- Cc: tech_(_at_)_openbsd_(_dot_)_org
[ This applies to version 1.29 of src/sys/sys/mount.h -- anoncvs mirrors
may not yet be up to date. ]
The short story:
You must build and boot a new kernel before running a "make build"
or the build will fail with "unimplemented system call" errors.
The long story:
I just committed new statfs(2), fstatfs(2), and getfsstat(2)
system calls that use a new "struct statfs". Details follow.
The new struct statfs has the following featuires
1) Has a u_int32_t flags field--now softdep can have a real flag.
2) Uses u_int32_t instead of longs (nicer on the alpha).
Note: the man page used to lie about setting invalid/unused
fields to -1. SunOS does that but our code never has.
3) Gets rid of f_type completely. It hasn't been used since NetBSD 0.9
and having it there but always 0 is confusing. It is conceivable
that this may cause some old code to not compile but that is better
than silently breaking.
4) Adds a mount_info union that contains the FSTYPE_args struct
(inspired by Digital UNIX). This means that "mount" can now
tell you all the options a filesystem was mounted with.
This is especially nice for NFS.
Other changes:
1) The linux statfs emulation didn't convert between BSD fs names
and linux f_type numbers. Now it does, since the BSD f_type
number is useless to linux apps ;-)
2) FreeBSD's struct statfs is different from our (both old and new)
and thus needed conversion. Previously, the OpenBSD syscalls
were used without any real translation.
The cool part:
mount(8) has been modified to use mount_info for filesystems with *_args
structs. Previously, mount with no args would print:
xerxes:/home/cvs on /cvs type nfs
Now, it prints:
xerxes:/home/cvs on /cvs type nfs (v3, tcp)
And "mount -v" shows:
xerxes:/home/cvs on /cvs type nfs (rw, v3, hard, tcp, wsize=8192, \
rsize=8192, rdirsizerdirsize=8192, timeo=10, retrans=10, \
maxgrouplist=16, readahead=1)
In non-verbose mode mount only prints things that differ from the defaults.
Also, mount_nfs has been fixed such that NFSV3 mounts now use TCP by
default, like other OS's do.
Visit your host, monkey.org