HomeFreeBSD

vfs: release usecount using fetchadd

Description

vfs: release usecount using fetchadd

  1. If we release the last usecount we take ownership of the hold count, which

means the vnode will remain allocated until we vdrop it.

  1. If someone else vrefs they will find no usecount and will proceed to add

their own hold count.

  1. No code has a problem with v_usecount transitioning to 0 without the

interlock

These facts combined mean we can fetchadd instead of having a cmpset loop.

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

Details

Provenance
mjgAuthored on
Reviewer
kib
Differential Revision
D21528: vfs: release usecount using fetchadd
Parents
rS352299: MFC r352201: Fix assumptions of only one device per SES slot.
Branches
Unknown
Tags
Unknown