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)
Mon, Sep 29, 6:45 AM
Unknown Object (File)
Sun, Sep 28, 3:52 AM
Unknown Object (File)
Mon, Sep 15, 4:56 PM
Unknown Object (File)
Sep 7 2025, 2:05 AM
Unknown Object (File)
Aug 3 2025, 2:13 AM
Unknown Object (File)
Aug 1 2025, 9:22 PM
Unknown Object (File)
Jul 27 2025, 9:53 PM
Unknown Object (File)
Jul 14 2025, 5:35 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.