Skip to content

Commit dae575e

Browse files
author
Al Viro
committed
backing_file_user_path(): constify struct path *
Callers never use the resulting pointer to modify the struct path it points to (nor should they). 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 b320789 commit dae575e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

fs/file_table.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct backing_file {
5454

5555
#define backing_file(f) container_of(f, struct backing_file, file)
5656

57-
struct path *backing_file_user_path(const struct file *f)
57+
const struct path *backing_file_user_path(const struct file *f)
5858
{
5959
return &backing_file(f)->user_path;
6060
}

include/linux/fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2879,7 +2879,7 @@ struct file *dentry_open_nonotify(const struct path *path, int flags,
28792879
const struct cred *cred);
28802880
struct file *dentry_create(const struct path *path, int flags, umode_t mode,
28812881
const struct cred *cred);
2882-
struct path *backing_file_user_path(const struct file *f);
2882+
const struct path *backing_file_user_path(const struct file *f);
28832883

28842884
/*
28852885
* When mmapping a file on a stackable filesystem (e.g., overlayfs), the file

0 commit comments

Comments
 (0)