zfs_znode_alloc should not call vn_reinit
zfs_znode_alloc pulls a fresh znode from znode_cache, whose constructor calls vn_alloc so it points to a fresh vnode. vn_reinit there is redundant.
Updated by Ryan Zezeski over 6 years ago
After discussing with Robert Mustacchi and reading the code (vnode.h,
vnode.c, zfs_znode.c), I've determined this change should not be made.
Both znode and vnode allocation are backed by object caches. These
caches reduce instruction count by reusing pre-allocated objects, in
this case znodes and vnodes. For any given call to `zfs_znode_alloc()`
there is no guarantee `zfs_znode_cache_constructor()` is called; thus
no guarantee that `vn_alloc()` is called. This is good, we want to
avoid the expensive initialization. However, vnode.h explicitly states
that any reused vnode MUST be reinitialized via `vn_reinit()`. This
code is doing exactly what it should.