vnode setup should be in vnode_cache_constructor
vn_alloc is currently responsible for some vnode initialisation, including calling vn_reinit. I see no reason this shouldn't be in the vnode_cache constructor.
Updated by Josef Sipek over 7 years ago
The problem here is that the vnode_cache_constructor gets called only once per object. That is, the code (vn_free) would have to free vnodes in a state that is identical to a vnode that's been just constructed. vn_free doesn't do this, hence the need for vn_alloc fixing things up.