>>> VFS_ROOT() is called after actual file system has been mounted. So >>> after VFS_ROOT() root vnode should always have a count >= 2. But when >>> I tried the same exercise with NFS3 it turned out to be 1 (which >>> according to me should have been at least 2)
it doesn't quite work the way you want, from a higher level view (like the interposing work you attempt to do) you can not make any particular assumptions on how many holds the underlaying file system may have applied to a particular vnode (e.g. add additonal holds for caching purposes, not applying constant holds as Bill pointed out for the nfs clients root vnode) all you can safely assume is that the vnode delivered to you via VFS_ROOT() has at least a reference count of 1, because VFS_ROOT() is supposed to deliver a VN_HELD() vnode. --- frankB