Subject: Re: Upgrade of `struct vnd_ioctl'
To: Christos Zoulas <firstname.lastname@example.org>
From: Quentin Garnier <email@example.com>
Date: 02/12/2007 21:06:22
Content-Type: text/plain; charset=us-ascii
On Mon, Feb 12, 2007 at 07:49:33PM +0000, Christos Zoulas wrote:
> In article <20070212054652.GA24959@baal.public.ulaval.ca>,
> Arnaud Lacombe <firstname.lastname@example.org> wrote:
> >On Sun, Feb 11, 2007 at 11:46:39PM +0100, Quentin Garnier wrote:
> >> On Sun, Feb 11, 2007 at 02:27:22PM -0500, Arnaud Lacombe wrote:
> >> > I'd like to change the size of the `vnd_size' member of struct vnd_i=
> >> > from `int' to `u_quad_t' (or any other unsigned 64bits type, but
> >> > u_quad_t is used by `struct vattr->va_size').
> >> uint64_t should be preferred for new code.
> >ok, done
> >> > Does the change needs any compatibility layer to be added ?=20
> >> The process is quite simple: keep a copy of the current structure with
> >> a different name (e.g., oldvnd_ioctl), and create new ioctl commands
> >> referencing that structure with the name OXXX.
> >> E.g.:
> >> #define OVNDIOCSET _IOWR('F', 0, struct oldvnd_ioctl)
> >> Then you add an entry in ioctl handler for those commands that do what
> >> they're supposed to do (i.e., in that case convert the value), and put
> >> those specific parts under COMPAT_40.
> >does the attached patch looks good ?
> > - Arnaud
First, you should decide if you want VNDIOOxxx or OVNDIOxxx and make it
consistent all through the patch.
Then, with that patch, VNDIOOCSET will not have the intended result...
And will write 4 extra bytes in memory or fault, depending on some
What you need to do in the OVNDIOxxx cases is actually *convert* data
(which points to a struct oldvnd_ioctl) into a struct vnd_ioctl.
Then it will be fine.
Quentin Garnier - email@example.com - cube@NetBSD.org
"You could have made it, spitting out benchmarks
Owe it to yourself not to fail"
Amplifico, Spitting Out Benchmarks, Hometakes Vol. 2, 2005.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (NetBSD)
-----END PGP SIGNATURE-----