Page MenuHomeFreeBSD

vfs: clean up vputx a little
ClosedPublic

Authored by mjg on Dec 7 2019, 2:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 5:07 PM
Unknown Object (File)
Thu, Apr 11, 5:07 PM
Unknown Object (File)
Feb 6 2024, 5:24 AM
Unknown Object (File)
Dec 20 2023, 3:30 AM
Subscribers

Details

Summary
  1. replace hand-rolled macros for operation type with enum
  2. unlock the vnode in vput itself, there is no need to branch on it. existence of VPUTX_VPUT remains significant in that the inactive variant adds LK_NOWAIT to locking request.
  3. remove the useless v_usecount assertion. few lines above the checks if v_usecount > 0 and leaves. should the value be negative, refcount would fail.
  4. the CTR return vnode %p to the freelist is incorrect as vdrop may find the vnode with holdcnt > 1. if the like should exist, it should be moved there
  5. there is no need to error = 0

Diff Detail

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

Event Timeline

This revision is now accepted and ready to land.Dec 7 2019, 8:57 PM
kib added inline comments.
sys/kern/vfs_subr.c
2915 ↗(On Diff #65349)

I would call it vputx_op

This revision was automatically updated to reflect the committed changes.