]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bpf...d_path(): constify path argument
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 6 Jul 2025 22:39:04 +0000 (18:39 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 16 Sep 2025 01:17:08 +0000 (21:17 -0400)
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/bpf_fs_kfuncs.c
kernel/trace/bpf_trace.c
tools/testing/selftests/bpf/bpf_experimental.h

index 1e36a12b88f75bdf885f3f07efe0c3f061595d21..5ace2511fec5117db02c7c84237c42358e8b4a2b 100644 (file)
@@ -79,7 +79,7 @@ __bpf_kfunc void bpf_put_file(struct file *file)
  * pathname in *buf*, including the NUL termination character. On error, a
  * negative integer is returned.
  */
-__bpf_kfunc int bpf_path_d_path(struct path *path, char *buf, size_t buf__sz)
+__bpf_kfunc int bpf_path_d_path(const struct path *path, char *buf, size_t buf__sz)
 {
        int len;
        char *ret;
index 3ae52978cae61a5d60b43c764d3e267bd32e1085..a8bd6a7351a32031b4051749a983f6911c139cce 100644 (file)
@@ -900,7 +900,7 @@ const struct bpf_func_proto bpf_send_signal_thread_proto = {
        .arg1_type      = ARG_ANYTHING,
 };
 
-BPF_CALL_3(bpf_d_path, struct path *, path, char *, buf, u32, sz)
+BPF_CALL_3(bpf_d_path, const struct path *, path, char *, buf, u32, sz)
 {
        struct path copy;
        long len;
index da7e230f2781e1e1181ea02c668b5a8f7f718051..c15797660cdff9e5f6b6f1ab85f788450fe35aa1 100644 (file)
@@ -219,7 +219,7 @@ extern void bpf_put_file(struct file *file) __ksym;
  *     including the NULL termination character, stored in the supplied
  *     buffer. On error, a negative integer is returned.
  */
-extern int bpf_path_d_path(struct path *path, char *buf, size_t buf__sz) __ksym;
+extern int bpf_path_d_path(const struct path *path, char *buf, size_t buf__sz) __ksym;
 
 /* This macro must be used to mark the exception callback corresponding to the
  * main program. For example: