Subject: Re: Upgrade of `struct vnd_ioctl'
To: Arnaud Lacombe <arnaud.lacombe.1@ulaval.ca>
From: Quentin Garnier <cube@cubidou.net>
List: tech-kern
Date: 02/11/2007 23:46:39
--Bs30vi9tNOOGUgTv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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_ioctl
> 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.

> Currently, it is quite easy make it either negative or greater than
> 2^32[1]. This field is only used when we call vnconfig(8) with -v
> (verbose).
>=20
> 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.

--=20
Quentin Garnier - cube@cubidou.net - 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.

--Bs30vi9tNOOGUgTv
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (NetBSD)

iQEVAwUBRc+cz9goQloHrPnoAQJBRgf/bz55ry/yfn/lkvsbMk2preLgVUWbi41k
eVC1yBvfYeRlHvnKnY2oU+TiGn6CLApleFOFF5kjZ5TyR5VCdm61DOfF+kKfBdHY
jjl7YmVm1cidaen6ypLMMDgp89LwKduvSN8DuoGeJloM3hl4bljeCZ9mykUEOGk2
9x5ulpSq/z+8A1014ON24Dnc/A9wpHo9P1voKl8W9GgnHI29AR4KmRXhWJAXtTFb
b3ADYlIKipLyYV8hxAYu0LjZihvYPNlkI5ox3AE8lA8krClnPQ0cKEiFtjv43g6S
AmntUBBw6UgdwJJP76OfnBe3yc+TA+JhYOM2bo6s3miPRajnLLmb8A==
=dbc9
-----END PGP SIGNATURE-----

--Bs30vi9tNOOGUgTv--