Re: which way to update export_args structure?

From: Rick Macklem <rmacklem_at_uoguelph.ca>
Date: Wed, 3 Oct 2018 14:51:27 +0000
Gary Jennejohn wrote:
[stuff snipped]
>In B, shouldn't ex_flags become uint32_t if all 32 bits can contain
>flag bits?
You could. For B) my intent was to leave the structure exactly the same as the
old versions and only add new fields at the end.  The current compatibility code in head does bcopy() of the structure, which means a change to uint32_t would require that to be re-written. (For A) it gets re-written anyhow.)

> And why make ex_flagshighbits a uint64_t?  You could
>make it uint32_t and simply shift the high bits around.
Again, you could. I didn't do that, since the code then does require bit shifts
every time you test a flag and I thought that would look messy.
I also get worried that compilers will do weird things like truncate the constant
to 32bits before the shift and drop the flag. (I do test cases for these in a little
program, but can only test i386.)
(The flags are constants defined in mount.h as MNT_xx for 64bits.)

Since I figured out a way that I think allows A) to be MFC'd, I'm leaning towards
A) anyhow.


rick
Received on Wed Oct 03 2018 - 12:51:29 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:18 UTC