]> www.infradead.org Git - users/willy/xarray.git/commit
bpf: support epoll from bpf struct_ops links.
authorKui-Feng Lee <thinker.li@gmail.com>
Thu, 30 May 2024 06:59:41 +0000 (23:59 -0700)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 30 May 2024 22:34:13 +0000 (15:34 -0700)
commit1adddc97aa44c8783f9f0276ea70854d56f9f6df
tree9bf857f946cbe8a3c1cdb08f759f981bb11d8f09
parent6fb2544ea1493f52e50b753604791c01bd2cf897
bpf: support epoll from bpf struct_ops links.

Add epoll support to bpf struct_ops links to trigger EPOLLHUP event upon
detachment.

This patch implements the "poll" of the "struct file_operations" for BPF
links and introduces a new "poll" operator in the "struct bpf_link_ops". By
implementing "poll" of "struct bpf_link_ops" for the links of struct_ops,
the file descriptor of a struct_ops link can be added to an epoll file
descriptor to receive EPOLLHUP events.

Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
Link: https://lore.kernel.org/r/20240530065946.979330-4-thinker.li@gmail.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
include/linux/bpf.h
kernel/bpf/bpf_struct_ops.c
kernel/bpf/syscall.c