HomeFreeBSD

nullfs: Slightly reduce contention by reducing concurrent sections

Description

nullfs: Slightly reduce contention by reducing concurrent sections

In null_lock_prep_with_smr(), initialize 'lvp' outside of the
SMR-protected section.

In null_lock(), if after locking the lower vnode we notice that we have
been reclaimed, we have to unlock the lower vnode and then relock our
own now that the lock isn't shared anymore. Call VOP_UNLOCK() on the
lower vnode as soon as this condition is known.

This applies comments from D38761, one of which was missed and the other
added too late.

Reviewed by: kib
MFC with: 641a58239520 ("nullfs: avoid the interlock in null_lock with smr")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52935