KFunc bpf_wakeup_sources_read_lock
Acquire the sleepable RCU lock for wake-up sources.
Definition
The underlying sleepable RCU lock returns an integer index. However, the BPF verifier requires a pointer (PTR_TO_BTF_ID) to strictly track the state of acquired resources using KF_ACQUIRE and KF_RELEASE semantics. We use an opaque structure pointer (struct bpf_ws_lock *) to satisfy the verifier while safely encoding the integer index within the pointer address itself.
Returns
An opaque pointer encoding the sleepable RCU lock index + 1 (to avoid NULL).
Signature
struct bpf_ws_lock *bpf_wakeup_sources_read_lock()
Note
This kfunc returns a pointer to a refcounted object. The verifier will then ensure that the pointer to the object
is eventually released using a release kfunc, or transferred to a map using a referenced kptr
(by invoking bpf_kptr_xchg). If not, the verifier fails the
loading of the BPF program until no lingering references remain in all possible explored states of the program.
Usage
Docs could be improved
This part of the docs is incomplete, contributions are very welcome
Program types
The following program types can make use of this kfunc:
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome