HomeFreeBSD

timerfd: Define a locking regime

Description

timerfd: Define a locking regime

Define a locking regime for the members of struct timerfd and document
it so future code can follow the standard. The lock legend can be found
in a comment above struct timerfd.

Additionally,
* Add assertions based on locking regime.
* Fill kn_data with the expiration count when EVFILT_READ is triggered.
* Report st_ctim for stat(2).
* Check if file has f_type == DTYPE_TIMERFD before assigning timerfd
  pointer to f_data.

MFC After: 3 days
Reviewed by: imp, kib, markj
Differential Revision: https://reviews.freebsd.org/D41600

(cherry picked from commit a1f506156c4db885d3cc177c93e9c8a28d535d30)

Details

Provenance
jfreeAuthored on Sep 17 2023, 3:01 PM
impCommitted on Sep 17 2023, 3:01 PM
Reviewer
imp
Differential Revision
D41600: timerfd: Define a locking regime
Parents
rGa87dddf39e86: timerfd: convert timerfd_list_lock from sx to mtx
Branches
Unknown
Tags
Unknown