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)
Tue, Dec 31, 9:02 PM
Unknown Object (File)
Mon, Dec 30, 9:50 PM
Unknown Object (File)
Sun, Dec 29, 9:46 PM
Unknown Object (File)
Sat, Dec 28, 10:18 PM
Unknown Object (File)
Sat, Dec 28, 12:33 AM
Unknown Object (File)
Dec 22 2024, 2:12 AM
Unknown Object (File)
Dec 22 2024, 2:10 AM
Unknown Object (File)
Dec 22 2024, 2:10 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.