Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bpf: Finish constification of 1st parameter of bpf_d_path()

The commit 1b8abbb12128 ("bpf...d_path(): constify path argument")
constified the first parameter of the bpf_d_path(), but failed to
update it in all places. Finish constification.

Otherwise the selftest fail to build:
.../selftests/bpf/bpf_experimental.h:222:12: error: conflicting types for 'bpf_path_d_path'
222 | extern int bpf_path_d_path(const struct path *path, char *buf, size_t buf__sz) __ksym;
| ^
.../selftests/bpf/tools/include/vmlinux.h:153922:12: note: previous declaration is here
153922 | extern int bpf_path_d_path(struct path *path, char *buf, size_t buf__sz) __weak __ksym;

Fixes: 1b8abbb12128 ("bpf...d_path(): constify path argument")
Signed-off-by: Rong Tao <rongtao@cestc.cn>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Rong Tao and committed by
Alexei Starovoitov
de734222 cbf33b8e

+4 -3
+1 -1
include/uapi/linux/bpf.h
··· 4891 4891 * 4892 4892 * **-ENOENT** if the bpf_local_storage cannot be found. 4893 4893 * 4894 - * long bpf_d_path(struct path *path, char *buf, u32 sz) 4894 + * long bpf_d_path(const struct path *path, char *buf, u32 sz) 4895 4895 * Description 4896 4896 * Return full path for given **struct path** object, which 4897 4897 * needs to be the kernel BTF *path* object. The path is
+1
scripts/bpf_doc.py
··· 788 788 'struct task_struct', 789 789 'struct cgroup', 790 790 'struct path', 791 + 'const struct path', 791 792 'struct btf_ptr', 792 793 'struct inode', 793 794 'struct socket',
+1 -1
tools/include/uapi/linux/bpf.h
··· 4891 4891 * 4892 4892 * **-ENOENT** if the bpf_local_storage cannot be found. 4893 4893 * 4894 - * long bpf_d_path(struct path *path, char *buf, u32 sz) 4894 + * long bpf_d_path(const struct path *path, char *buf, u32 sz) 4895 4895 * Description 4896 4896 * Return full path for given **struct path** object, which 4897 4897 * needs to be the kernel BTF *path* object. The path is
+1 -1
tools/testing/selftests/bpf/progs/verifier_vfs_accept.c
··· 70 70 int BPF_PROG(path_d_path_from_file_argument, struct file *file) 71 71 { 72 72 int ret; 73 - struct path *path; 73 + const struct path *path; 74 74 75 75 /* The f_path member is a path which is embedded directly within a 76 76 * file. Therefore, a pointer to such embedded members are still