Home
last modified time | relevance | path

Searched refs:path_fd (Results 1 – 8 of 8) sorted by relevance

/linux-6.12.1/tools/testing/selftests/bpf/prog_tests/
Dbpf_obj_pinning.c81 pin_opts.path_fd = mnt_fd; in bpf_obj_pinning_detached()
88 get_opts.path_fd = mnt_fd; in bpf_obj_pinning_detached()
148 pin_opts.path_fd = open("/sys/fs/bpf", O_PATH); in validate_pin()
149 ASSERT_GE(pin_opts.path_fd, 0, "path_fd"); in validate_pin()
159 if (path_kind == PATH_FD_REL && pin_opts.path_fd >= 0) in validate_pin()
160 close(pin_opts.path_fd); in validate_pin()
213 get_opts.path_fd = open("/sys/fs/bpf", O_PATH); in validate_get()
214 ASSERT_GE(get_opts.path_fd, 0, "path_fd"); in validate_get()
224 if (path_kind == PATH_FD_REL && get_opts.path_fd >= 0) in validate_get()
225 close(get_opts.path_fd); in validate_get()
/linux-6.12.1/kernel/bpf/
Dinode.c436 static int bpf_obj_do_pin(int path_fd, const char __user *pathname, void *raw, in bpf_obj_do_pin() argument
445 dentry = user_path_create(path_fd, pathname, &path, 0); in bpf_obj_do_pin()
478 int bpf_obj_pin_user(u32 ufd, int path_fd, const char __user *pathname) in bpf_obj_pin_user() argument
488 ret = bpf_obj_do_pin(path_fd, pathname, raw, type); in bpf_obj_pin_user()
495 static void *bpf_obj_do_get(int path_fd, const char __user *pathname, in bpf_obj_do_get() argument
503 ret = user_path_at(path_fd, pathname, LOOKUP_FOLLOW, &path); in bpf_obj_do_get()
527 int bpf_obj_get_user(int path_fd, const char __user *pathname, int flags) in bpf_obj_get_user() argument
538 raw = bpf_obj_do_get(path_fd, pathname, &type, f_flags); in bpf_obj_get_user()
Dsyscall.c2901 #define BPF_OBJ_LAST_FIELD path_fd
2905 int path_fd; in bpf_obj_pin() local
2911 if (!(attr->file_flags & BPF_F_PATH_FD) && attr->path_fd) in bpf_obj_pin()
2914 path_fd = attr->file_flags & BPF_F_PATH_FD ? attr->path_fd : AT_FDCWD; in bpf_obj_pin()
2915 return bpf_obj_pin_user(attr->bpf_fd, path_fd, in bpf_obj_pin()
2921 int path_fd; in bpf_obj_get() local
2928 if (!(attr->file_flags & BPF_F_PATH_FD) && attr->path_fd) in bpf_obj_get()
2931 path_fd = attr->file_flags & BPF_F_PATH_FD ? attr->path_fd : AT_FDCWD; in bpf_obj_get()
2932 return bpf_obj_get_user(path_fd, u64_to_user_ptr(attr->pathname), in bpf_obj_get()
/linux-6.12.1/tools/lib/bpf/
Dbpf.h306 int path_fd; member
310 #define bpf_obj_pin_opts__last_field path_fd
320 int path_fd; member
324 #define bpf_obj_get_opts__last_field path_fd
Dbpf.c584 const size_t attr_sz = offsetofend(union bpf_attr, path_fd); in bpf_obj_pin_opts()
592 attr.path_fd = OPTS_GET(opts, path_fd, 0); in bpf_obj_pin_opts()
613 const size_t attr_sz = offsetofend(union bpf_attr, path_fd); in bpf_obj_get_opts()
621 attr.path_fd = OPTS_GET(opts, path_fd, 0); in bpf_obj_get_opts()
/linux-6.12.1/include/linux/
Dbpf.h2394 int bpf_obj_pin_user(u32 ufd, int path_fd, const char __user *pathname);
2395 int bpf_obj_get_user(int path_fd, const char __user *pathname, int flags);
/linux-6.12.1/include/uapi/linux/
Dbpf.h1587 __s32 path_fd; member
/linux-6.12.1/tools/include/uapi/linux/
Dbpf.h1587 __s32 path_fd; member