Make it possible to call VOP_PUTPAGES with shared vnode lock instead
of insisting an exclusive lock.
When VFS_LOCK_DEBUG is enabled and when the underlying file system is
capable of MNT_SHARED_WRITES, a failed assertion may lead to a panic
because when calling fsync(2), a.k.a. sys_fsync() over a vnode with
mmap'ed page, it will grab a shared lock when underlying file system
is capable, then call vm_object_page_clean that eventually proceeded
to vnode_pager_putpages() that tries to do VOP_PUTPAGES, where
VOP_PUTPAGES_APV generated from the declaration asserts the vnode is
always exclusively locked by caller.
This is a direct commit to stable/8 because a majority portion of the
original changeset 257899 (kib), which main goal was an optimization,
was omitted. We saw the panic independently in a FreeNAS bug ticket
(#4578).
git-svn-id: svn://svn.freebsd.org/base/stable/8@263376
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f