mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
fs: constify file ptr in backing_file accessor helpers
Add internal helper backing_file_set_user_path() for the only two cases that need to modify backing_file fields. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Link: https://lore.kernel.org/20250607115304.2521155-2-amir73il@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
committed by
Christian Brauner
parent
bc9241367a
commit
4e301d858a
@@ -41,7 +41,7 @@ struct file *backing_file_open(const struct path *user_path, int flags,
|
||||
return f;
|
||||
|
||||
path_get(user_path);
|
||||
*backing_file_user_path(f) = *user_path;
|
||||
backing_file_set_user_path(f, user_path);
|
||||
error = vfs_open(real_path, f);
|
||||
if (error) {
|
||||
fput(f);
|
||||
@@ -65,7 +65,7 @@ struct file *backing_tmpfile_open(const struct path *user_path, int flags,
|
||||
return f;
|
||||
|
||||
path_get(user_path);
|
||||
*backing_file_user_path(f) = *user_path;
|
||||
backing_file_set_user_path(f, user_path);
|
||||
error = vfs_tmpfile(real_idmap, real_parentpath, f, mode);
|
||||
if (error) {
|
||||
fput(f);
|
||||
|
||||
Reference in New Issue
Block a user