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)
Sat, Aug 22, 9:37 AM
Unknown Object (File)
Fri, Aug 14, 7:44 PM
Unknown Object (File)
Fri, Aug 14, 2:12 AM
Unknown Object (File)
Thu, Aug 13, 9:10 PM
Unknown Object (File)
Thu, Aug 13, 6:16 PM
Unknown Object (File)
Thu, Aug 13, 2:03 PM
Unknown Object (File)
Tue, Aug 11, 10:58 PM
Unknown Object (File)
Mon, Aug 10, 1:54 PM
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.