HomeFreeBSD

filedesc: get rid of atomic_load_acq_int from fget_unlocked

Description

filedesc: get rid of atomic_load_acq_int from fget_unlocked

A read barrier was necessary because fd table pointer and table size were
updated separately, opening a window where fget_unlocked could read new size
and old pointer.

This patch puts both these fields into one dedicated structure, pointer to which
is later atomically updated. As such, fget_unlocked only needs data a dependency
barrier which is a noop on all supported architectures.

Reviewed by: kib (previous version)
MFC after: 2 weeks

Details

Provenance
mjgAuthored on
Parents
rS273841: MFC r266842: netinet/in.h: Expose htonl(), htons(), ntohl() and ntohs() in
Branches
Unknown
Tags
Unknown

Event Timeline