libbpf: Fix lookup_and_delete_elem_flags
PATCH 1/1 libbpf: Fix lookup_and_delete_elem_flags
Added libbpf_err_errno to bpf_map_lookup_and_delete_elem_flags
Signed-off-by Mehrdad Arshad Rad <[email protected]>
--- tools/lib/bpf/bpf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/lib/bpf/bpf.c +3 -1
@@ -515,6 +515,7 @@ int bpf_map_lookup_and_delete_elem(int fd, const void *key, void *value)int bpf_map_lookup_and_delete_elem_flags (int fd,const void *key,void *value,__u64 flags) {union bpf_attr attr; +int ret;memset (&attr,0 ,sizeof (attr)); attr.map_fd = fd;
@@ -522,7 +523,8 @@ int bpf_map_lookup_and_delete_elem_flags(int fd, const void *key, void *value, _ attr.value =ptr_to_u64 (value); attr.flags = flags; -return sys_bpf (BPF_MAP_LOOKUP_AND_DELETE_ELEM , &attr,sizeof (attr)); + ret =sys_bpf (BPF_MAP_LOOKUP_AND_DELETE_ELEM , &attr,sizeof (attr)); +return libbpf_err_errno (ret); }int bpf_map_delete_elem (int fd,const void *key)
Signature · 1 line
2.25.1
Quoted 3 lines · Mehrdad Arshad Rad
Added
libbpf_err_errnotobpf_map_lookup_and_delete_elem_flagsSigned-off-by Mehrdad Arshad Rad <[email protected]>
Acked-by Yonghong Song <[email protected]>
This patch was applied to bpf/bpf.git (master) by Daniel Borkmann <[email protected]>:
Hello:
This patch was applied to bpf/bpf.git (master)
by Daniel Borkmann <[email protected]>:
Quoted 6 lines · On Thu, 4 Nov 2021 10:13:54 -0700 you wrote:
Added
libbpf_err_errnotobpf_map_lookup_and_delete_elem_flagsSigned-off-by Mehrdad Arshad Rad <[email protected]>--- tools/lib/bpf/bpf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Here is the summary with links:
- libbpf: Fix lookup_and_delete_elem_flags
https://git.kernel.org/bpf/bpf/c/64165ddf8ea1
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html