Commit de734222 authored by Rong Tao's avatar Rong Tao Committed by Alexei Starovoitov
Browse files

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



The commit 1b8abbb1 ("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: 1b8abbb1 ("bpf...d_path(): constify path argument")
Signed-off-by: default avatarRong Tao <rongtao@cestc.cn>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent cbf33b8e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4891,7 +4891,7 @@ union bpf_attr {
 *
 *		**-ENOENT** if the bpf_local_storage cannot be found.
 *
 * long bpf_d_path(struct path *path, char *buf, u32 sz)
 * long bpf_d_path(const struct path *path, char *buf, u32 sz)
 *	Description
 *		Return full path for given **struct path** object, which
 *		needs to be the kernel BTF *path* object. The path is
+1 −0
Original line number Diff line number Diff line
@@ -788,6 +788,7 @@ class PrinterHelpersHeader(Printer):
            'struct task_struct',
            'struct cgroup',
            'struct path',
            'const struct path',
            'struct btf_ptr',
            'struct inode',
            'struct socket',
+1 −1
Original line number Diff line number Diff line
@@ -4891,7 +4891,7 @@ union bpf_attr {
 *
 *		**-ENOENT** if the bpf_local_storage cannot be found.
 *
 * long bpf_d_path(struct path *path, char *buf, u32 sz)
 * long bpf_d_path(const struct path *path, char *buf, u32 sz)
 *	Description
 *		Return full path for given **struct path** object, which
 *		needs to be the kernel BTF *path* object. The path is
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ __success
int BPF_PROG(path_d_path_from_file_argument, struct file *file)
{
	int ret;
	struct path *path;
	const struct path *path;

	/* The f_path member is a path which is embedded directly within a
	 * file. Therefore, a pointer to such embedded members are still