HomeFreeBSD

vfs: implement usecount implying holdcnt

Description

vfs: implement usecount implying holdcnt

vnodes have 2 reference counts - holdcnt to keep the vnode itself from getting
freed and usecount to denote it is actively used.

Previously all operations bumping usecount would also bump holdcnt, which is
not necessary. We can detect if usecount is already > 1 (in which case holdcnt
is also > 1) and utilize it to avoid bumping holdcnt on our own. This saves
on atomic ops.

Reviewed by: kib
Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21471

Details

Provenance
mjgAuthored on
Reviewer
kib
Differential Revision
D21471: vfs: implement usecount implies holdcnt
Parents
rS351747: Implement nvme suspend / resume for pci attachment
Branches
Unknown
Tags
Unknown