Skip to content

Commit 1b8abbb

Browse files
author
Al Viro
committed
bpf...d_path(): constify path argument
Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 63dbfb0 commit 1b8abbb

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

fs/bpf_fs_kfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ __bpf_kfunc void bpf_put_file(struct file *file)
7979
* pathname in *buf*, including the NUL termination character. On error, a
8080
* negative integer is returned.
8181
*/
82-
__bpf_kfunc int bpf_path_d_path(struct path *path, char *buf, size_t buf__sz)
82+
__bpf_kfunc int bpf_path_d_path(const struct path *path, char *buf, size_t buf__sz)
8383
{
8484
int len;
8585
char *ret;

kernel/trace/bpf_trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ const struct bpf_func_proto bpf_send_signal_thread_proto = {
900900
.arg1_type = ARG_ANYTHING,
901901
};
902902

903-
BPF_CALL_3(bpf_d_path, struct path *, path, char *, buf, u32, sz)
903+
BPF_CALL_3(bpf_d_path, const struct path *, path, char *, buf, u32, sz)
904904
{
905905
struct path copy;
906906
long len;

tools/testing/selftests/bpf/bpf_experimental.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ extern void bpf_put_file(struct file *file) __ksym;
219219
* including the NULL termination character, stored in the supplied
220220
* buffer. On error, a negative integer is returned.
221221
*/
222-
extern int bpf_path_d_path(struct path *path, char *buf, size_t buf__sz) __ksym;
222+
extern int bpf_path_d_path(const struct path *path, char *buf, size_t buf__sz) __ksym;
223223

224224
/* This macro must be used to mark the exception callback corresponding to the
225225
* main program. For example:

0 commit comments

Comments
 (0)