Skip to content

Commit d18d477

Browse files
christycyleeNobody
authored and
Nobody
committed
libbpf: deprecate bpf_object__open_xattr() API
Deprecate bpf_object__open_xattr() in favor of bpf_object__open_mem() instead. Signed-off-by: Christy Lee <[email protected]>
1 parent 66cbeee commit d18d477

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

tools/lib/bpf/libbpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9443,7 +9443,7 @@ static int bpf_prog_load_xattr2(const struct bpf_prog_load_attr *attr,
94439443
open_attr.file = attr->file;
94449444
open_attr.prog_type = attr->prog_type;
94459445

9446-
obj = bpf_object__open_xattr(&open_attr);
9446+
obj = libbpf_ptr(__bpf_object__open_xattr(&open_attr, 0));
94479447
err = libbpf_get_error(obj);
94489448
if (err)
94499449
return libbpf_err(-ENOENT);

tools/lib/bpf/libbpf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ LIBBPF_DEPRECATED_SINCE(0, 8, "use bpf_object__open_mem() instead")
185185
LIBBPF_API struct bpf_object *
186186
bpf_object__open_buffer(const void *obj_buf, size_t obj_buf_sz,
187187
const char *name);
188+
LIBBPF_DEPRECATED_SINCE(0, 8, "use bpf_object__open_mem() instead")
188189
LIBBPF_API struct bpf_object *
189190
bpf_object__open_xattr(struct bpf_object_open_attr *attr);
190191

0 commit comments

Comments
 (0)