diff options
| author | Amir Goldstein <amir73il@gmail.com> | 2025-06-07 13:53:03 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-07-18 11:09:29 +0200 |
| commit | 4e301d858af17ae2ce56886296e5458c5a08219a (patch) | |
| tree | 2334373c7920868f933ae24fb06cf84ade90d5ca /fs/file_table.c | |
| parent | bc9241367aac08de44633fd957b2452a6da8e6d4 (diff) | |
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>
Diffstat (limited to 'fs/file_table.c')
| -rw-r--r-- | fs/file_table.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/file_table.c b/fs/file_table.c index 138114d64307..f09d79a98111 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -52,17 +52,20 @@ struct backing_file { }; }; -static inline struct backing_file *backing_file(struct file *f) -{ - return container_of(f, struct backing_file, file); -} +#define backing_file(f) container_of(f, struct backing_file, file) -struct path *backing_file_user_path(struct file *f) +struct path *backing_file_user_path(const struct file *f) { return &backing_file(f)->user_path; } 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; +} +EXPORT_SYMBOL_GPL(backing_file_set_user_path); + static inline void file_free(struct file *f) { security_file_free(f); |