OpenSolaris

You are not signed in. Sign in or register.

Heads up! Strong typechecking for vnode/vfs/FEM operations

Date: Mon, 26 Mar 2007 19:43:59 -0500
From: Rich Brown <Rich.Brown at Sun dot COM>
To: onnv-gate at onnv dot eng dot sun dot com, on-all at eng dot sun dot com
Subject: Heads up! Strong typechecking for vnode/vfs/FEM operations

If you don't care about vnode operations, vfs operations, or FEM
operations you are welcome to hit DELETE.

Still with me?  Good, good.  You're gonna like this...

My putback for...

   PSARC/2007/124 Strong Type-Checking for VFS Operation Registration Mechanism
   6505923 Need better type checking for vnodeops

...means that we now have strong-typechecking for vnode/vfs/FEM
operations.

(We didn't before...  Long story... See the PSARC case.)

Previously, a file system would specify its vnode ops using a
template like the following:

	const fs_operation_def_t xxx_vnodeops_template[] = {
		{ VOPNAME_OPEN,		xxx_open },
		{ VOPNAME_CLOSE,	xxx_close },
		...
	};

With this putback, file systems will now specify their vnodes ops as
follows:

	const fs_operation_def_t xxx_vnodeops_template[] = {
		{ VOPNAME_OPEN,		.vop_open = xxx_open },
		{ VOPNAME_CLOSE,	.vop_close = xxx_close },
		...
	};

The ".vop_open = xxx_open" means that the xxx_open() function will be
type-checked against the vop_open definition and any errors in the
signature will be flagged by the compiler.

The same applies to vfs ops and FEM ops.

FWIW, during development I found several file systems that had vnode
operations with the incorrect signatures.  Those have, of course, been
corrected.

Finally, the operation registration structure/union definitions and
function declarations have been moved to <sys/vfs_opreg.h> so file
systems that register operations will need to include that header
file.

See http://sac.sfbay.sun.com/PSARC/2007/124/mail for further details.
If you have further questions, feel free to send them my way.

Happy VOP'ing...

	Rich