HomeFreeBSD

sockets: use positive flag for file descriptor socket reference

Description

sockets: use positive flag for file descriptor socket reference

Rename SS_NOFDREF to SS_FDREF and flip all bitwise operations.
Mark sockets created by socreate() with SS_FDREF.

This change is mostly illustrative. With it we see that SS_FDREF
is a debugging flag, since:

  • socreate() takes a reference with soref().
  • on accept path solisten_dequeue() takes a reference with soref() and then soaccept() sets SS_FDREF.
  • soclose() checks SS_FDREF, removes it and does sorele().

Reviewed by: tuexen
Differential revision: https://reviews.freebsd.org/D35678

Details

Provenance
glebiusAuthored on Jul 4 2022, 7:40 PM
Reviewer
tuexen
Differential Revision
D35678: sockets: use positive flag for file descriptor socket reference
Parents
rG74703901d8bb: tcp: use a TCP flag to check if connection has been close(2)d
Branches
Unknown
Tags
Unknown