summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-06-11 12:13:10 +0300
committerChristian Brauner <brauner@kernel.org>2025-07-18 12:09:33 +0300
commit04060e7860cb2dad21898248f7e7f7575ce44a14 (patch)
treeb5435c2513479ef752faaeed155d919098547a11 /include/linux
parentbc9241367aac08de44633fd957b2452a6da8e6d4 (diff)
parent3ec2529eca6f175f4e3e87c4534010e044839b38 (diff)
downloadlinux-04060e7860cb2dad21898248f7e7f7575ce44a14.tar.xz
Merge patch series "backing_file accessors cleanup"
Amir Goldstein <amir73il@gmail.com> says: As promissed, here is the backing_file accessors cleanup that was dicussed on the overlayfs pr [1]. I have kept the ovl patch separate from the vfs patch, so that the vfs patch could be backported to stable kernels, because the ovl patch depends on master of today. * patches from https://lore.kernel.org/20250607115304.2521155-1-amir73il@gmail.com: ovl: remove unneeded non-const conversion fs: constify file ptr in backing_file accessor helpers Link: https://lore.kernel.org/linux-fsdevel/CAOQ4uxgFJCikAi4o4e9vzXTH=cUQGyvoo+cpdtfmBwJzutSCzw@mail.gmail.com/ [1] Link: https://lore.kernel.org/20250607115304.2521155-1-amir73il@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 1d9586a78041..8116b1080457 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2864,7 +2864,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(struct file *f);
+struct path *backing_file_user_path(const struct file *f);
/*
* When mmapping a file on a stackable filesystem (e.g., overlayfs), the file
@@ -2876,14 +2876,14 @@ struct path *backing_file_user_path(struct file *f);
* by fstat() on that same fd.
*/
/* Get the path to display in /proc/<pid>/maps */
-static inline const struct path *file_user_path(struct file *f)
+static inline const struct path *file_user_path(const struct file *f)
{
if (unlikely(f->f_mode & FMODE_BACKING))
return backing_file_user_path(f);
return &f->f_path;
}
/* Get the inode whose inode number to display in /proc/<pid>/maps */
-static inline const struct inode *file_user_inode(struct file *f)
+static inline const struct inode *file_user_inode(const struct file *f)
{
if (unlikely(f->f_mode & FMODE_BACKING))
return d_inode(backing_file_user_path(f)->dentry);