Subject: Re: statfs, statvfs and friends.
To: Bill Studenmund <wrstuden@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-kern
Date: 03/30/2004 21:18:59
On Mar 30, 6:10pm, wrstuden@netbsd.org (Bill Studenmund) wrote:
-- Subject: Re: statfs, statvfs and friends.
| > Issues [I supply my opinions...]
| >=20
| > 1. Q: what should be the old ones named __foostatfs20()?
| > A: I say yes since there is precedence of using the last OS version
| > supported them natively.
|
| ?? You mean the old structures or the old calls?
both.
| The old calls stay statfs() & such, their structure should be statfs16,=20
| and you use a __RENAME() to map statfs to __statfs20(). The new calls=20
| should be __statfs20().
|
| Note: I think you should pull this change into 2.0. :-)
Heh, then it should not be __foo20, it should be __foo16.
| Note: the number for the call is the version where the call appeared, not=
| =20
| the last one to use it. Look at how stat() is handled in sys/stat.h.
stat was changed in 1.3; the 12 was the libc version. Since then we've
changed the way we do this (accidentally).
| > 2. Q: Should we go all the way and implement statvfs()?
| > A: I think so. statfs() is a berkeleism.
|
| Don't forget fstatvfs() and fhstatvfs().
Of course.
|
| > 2a. Q: If we supply statvfs(), then do we still supply statfs too?
| > A: Not sure.
|
| Yes.
Ok, then the question becomes is *statfs() just a libc wrapper?
| > 2b. Q: X/Open says we should use unsigned long for bsize, frsize and
| > fsblkcnt_t for the rest. Should we do that?
| > A: I say keep the types as I have them.
|
| If the standards say long and it isn't stupid, I'd say use "long".
Yes we should follow the standards.
| > 2c. Q: bsize in statfs() has been the fragment size; bsize in statvfs()
| > is the block size, and frsize is the fragment size. Should we go
| > the statvfs() way.
| > A: I propose go that way too.
|
| Ick. That's be redefining what bsize is. I'm not sure about it.
Well, the wrapper in libc can dtrt.
| > 3. Q: I added more stats, favail [statvfs has it too], is there anything =
| else
| > we need?
| > A: ???
| > 4. Q: Should we change sys_getstatfs() to take size_t instead of long as
| > the second arg.
| > A: I think so.
|
| No thoughts on those.
Okay. Thanks for the feedback.
christos