[OpenAFS-devel] casts vnode<->vcache

Johan Danielsson joda+openafs@pdc.kth.se
22 Mar 2002 19:15:56 +0100


Currently the code does (struct vcache*)vnode all over the place,
which is fine for systems that either have variable size vnodes, or
have a large enough vnode to hold a whole vcache. This does not
include BSD:s.

I'd like to propose a change that replaces all casts with macros that
does:

#define VTOAFS(vnode) ((struct vcache*)(vnode))
#define AFSTOV(vcache) ((struct vnode*)(vcache))

and the BSD equivalent version would look like this:

#define VTOAFS(vnode) ((struct vcache*)(vnode)->v_data)
#define AFSTOV(vcache) ((struct vnode*)(vcache)->vnode)

If I submit a patch that implements this, will it be committed? This
change is not likely enough, as I suspect that there are implicit
casts around, but it would not hurt any existing platform, and make it
easier to port to more systems.

Are there more things to think about here?

/Johan