[PATCH 01/10] fs: unexport backing_file_set_user_path() and make it take the ref on its own

From: Mateusz Guzik

Date: Sun Sep 13 2026 - 10:52:55 EST


Prep for path_* API changes, which will force the ref change.

There are likely no users outside of the tree, but should there be some they
will no longer be caught by surprise.

Signed-off-by: Mateusz Guzik <mjguzik@xxxxxxxxx>
---
fs/backing-file.c | 2 --
fs/file_table.c | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/backing-file.c b/fs/backing-file.c
index cc101143f921..e92410a27982 100644
--- a/fs/backing-file.c
+++ b/fs/backing-file.c
@@ -43,7 +43,6 @@ struct file *backing_file_open(const struct file *user_file, int flags,
if (IS_ERR(f))
return f;

- path_get(user_path);
backing_file_set_user_path(f, user_path);
error = vfs_open(real_path, f);
if (error) {
@@ -68,7 +67,6 @@ struct file *backing_tmpfile_open(const struct file *user_file, int flags,
if (IS_ERR(f))
return f;

- path_get(user_path);
backing_file_set_user_path(f, user_path);
error = vfs_tmpfile(real_idmap, real_parentpath, f, mode);
if (error) {
diff --git a/fs/file_table.c b/fs/file_table.c
index 8dcd213c0251..f9d1b5edd6ae 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -71,8 +71,8 @@ EXPORT_SYMBOL_GPL(backing_file_user_path);
void backing_file_set_user_path(struct file *f, const struct path *path)
{
backing_file(f)->user_path = *path;
+ path_get(path);
}
-EXPORT_SYMBOL_GPL(backing_file_set_user_path);

#ifdef CONFIG_SECURITY
void *backing_file_security(const struct file *f)
--
2.53.0