]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
backing_file_user_path(): constify struct path *
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 5 Sep 2025 03:16:35 +0000 (23:16 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 16 Sep 2025 01:17:07 +0000 (21:17 -0400)
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>
fs/file_table.c
include/linux/fs.h

index 81c72576e548f217710852fa5535c9fc738bfb76..85b53e39138debd4d495a07129e170f1224d5cd4 100644 (file)
@@ -54,7 +54,7 @@ struct backing_file {
 
 #define backing_file(f) container_of(f, struct backing_file, file)
 
-struct path *backing_file_user_path(const struct file *f)
+const struct path *backing_file_user_path(const struct file *f)
 {
        return &backing_file(f)->user_path;
 }
index d7ab4f96d7051f23246c1a16a2d09b1ffcd2d5de..3bcc878817be9b90762fca3a85e30cd58648e7c1 100644 (file)
@@ -2879,7 +2879,7 @@ struct file *dentry_open_nonotify(const struct path *path, int flags,
                                  const struct cred *cred);
 struct file *dentry_create(const struct path *path, int flags, umode_t mode,
                           const struct cred *cred);
-struct path *backing_file_user_path(const struct file *f);
+const struct path *backing_file_user_path(const struct file *f);
 
 /*
  * When mmapping a file on a stackable filesystem (e.g., overlayfs), the file