[OpenAFS-devel] casts vnode<->vcache

Johan Danielsson joda+openafs@pdc.kth.se
24 Mar 2002 02:02:10 +0100


Chaskiel M Grundman <cg2v@andrew.cmu.edu> writes:

> It also works in cases where the pointer points at a struct vcache
> sized piece of memory, instead of a struct vnode sized chunk
> acquired from getnewvnode()

Oh, you mean the nice vrefcount++ hack? I wouldn't call that "works".

> whis is what afs does on all the platforms except OSF/DUX/Tru64.

Which also works only because a struct rnode happens to be larger than
a struct vcache. Add six more pointers to struct vcache, and
everything blows up (that this will likely never happen is beside the
point).

> This change isn't necessarily bad, but fixing the big issue is more
> complicated than getting rid of the casts.

Of course, did I suggest anything else? For NetBSD you have to call
getnewvnode, plus use pool_get for the actual vcache data, and then
write a reclaim routine that pool_puts it back. About 70% of
afs_NewVCache just vanishes.

/Johan