Page MenuHomeFreeBSD

3/3 vfs: refactor vputx and add more comments
ClosedPublic

Authored by mjg on Feb 6 2020, 12:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 12 2024, 4:56 AM
Unknown Object (File)
Mar 7 2024, 8:43 PM
Unknown Object (File)
Jan 28 2024, 1:17 AM
Unknown Object (File)
Dec 20 2023, 3:24 AM
Unknown Object (File)
Dec 12 2023, 4:36 AM
Unknown Object (File)
Nov 15 2023, 8:51 AM
Unknown Object (File)
Nov 11 2023, 11:16 AM
Unknown Object (File)
Nov 9 2023, 11:19 AM
Subscribers

Details

Summary

the vnode interlock relocking for vchr in vrele may seem problematic, but it almost never happens in practice. I take it for readability.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mjg retitled this revision from vfs: refactor vputx and add more comments to 3/3 vfs: refactor vputx and add more comments.Feb 6 2020, 12:20 AM
mjg edited the summary of this revision. (Show Details)
sys/kern/vfs_subr.c
3200 ↗(On Diff #67846)

Can we rename this vput_final or vput_last or something. At first glance it was confusing to me for historical reasons.

3327 ↗(On Diff #67846)

It's not clear to me why all of the release routines don't have this VCHR code.

sys/kern/vfs_subr.c
2802–2804 ↗(On Diff #67846)

The caller is required to hold the interlock when transitioning a VCHR usecount to zero. This prevents a race with devfs_reclaim_vchr() that would leak a si_usecount reference. The vnode lock will also prevent this race if it is held while dropping the last ref.

2810 ↗(On Diff #67846)

vrele()
decr v_usecount

2812 ↗(On Diff #67846)

v_usecount == 0, does not decrement si_usecount
v_rdev = NULL

2817 ↗(On Diff #67846)

v_decr_devcount()
v_dev == NULL, does not decrement si_usecount

This revision is now accepted and ready to land.Feb 12 2020, 4:16 AM
This revision was automatically updated to reflect the committed changes.