svn commit: r210740 - in stable/8/sys/fs: nfs nfsclient

Bruce Evans brde at optusnet.com.au
Mon Aug 2 07:17:00 UTC 2010


On Sun, 1 Aug 2010, Rick Macklem wrote:

> Log:
>  MFC: r210201
>  Change the nfscl_mustflush() function in the experimental NFSv4
>  client to return a boolean_t in order to make it more compatible
>  with style(9).

Er, this makes it less compatible.  style(9) doesn't mention any of
boolean_t, TRUE or FALSE, and it doesn't dream of the C99 <stdbool.h>
or its true, false, bool, _Bool or __bool_true_and_false_are_defined.
I believe the former are Mach style, which is foreign to BSD style
and was used mainly in the Mach-derived in BSD, especially before I
moved the typedef for boolean_t from a vm header to <sys/types.h> in
1995.

In Lite2 kern/*.c, there is a whole 1 use of TRUE and that is for a
vm call; there are 3 uses of FALSE, all for vm calls; there are no
uses of boolean_t although this was wrong for non-prototyped functions
since some vm functions take or return a boolean_t.  E.g., kmem_malloc()
was passed an uncast plain int where a boolean_t is required, so the
behaviour was undefined unless boolean_t was int (which it was and still
is in the kernel) or there was a prototype in scope (which there should
have been by 1993, but the system pretended to support K&R compilers).

In Lite2 vm/*.c, there are 64 uses of TRUE, 80 of FALSE and 85 of
boolean_t (49 more boolean_t's in *.h).  Now the counts are 10%
smaller despite vm being 2.2 times larger.  I guess this is due to
stronger adherence to style rules in Mach.

In Lite2 nfs/*.c, there are 27 uses of TRUE, 41 of FALSE and none of
boolean_t.

So booleans in nfs are nfs(rmacklem) style except for the newfangled
boolean_t (which is now > 10 years out of date with standard type)
but not BSD style :-).

Bruce


More information about the svn-src-all mailing list