summaryrefslogtreecommitdiff
path: root/fs/ext2
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2026-09-01 14:14:47 +0200
committerChristian Brauner <brauner@kernel.org>2026-09-23 09:19:51 +0200
commiteb50cbe14ff97ea533708bfc40a74df7af380e5f (patch)
tree04255d6bd0627986926ea9a95d044ac9a12bd23b /fs/ext2
parent6bd532e338759278b5cc1e912cf9b67a997e658c (diff)
fs: port ->create() to pass const mnt_idmap
Convert to const struct mnt_idmap. A mount's idmapping is immutable. The only thing that is allowed to be modified afterwards is the reference count and that is hidden behind mnt_idmap_get() and mnt_idmap_put(). Everything else only ever reads from the idmapping. This is the same model that struct cred uses and the idmapping is also rather sensitive. So make the idmap argument const wherever we can. The conversion is done from the bottom up so callers can continue to pass a non-const pointer to a const parameter until the conversion is finished. No functional changes. Link: https://patch.msgid.link/20260901-work-idmap-const-v1-22-54ccd48e100b@kernel.org Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Seth Forshee <sforshee@kernel.org> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'fs/ext2')
-rw-r--r--fs/ext2/namei.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c
index 7da42f071eab..bfb6a463a95e 100644
--- a/fs/ext2/namei.c
+++ b/fs/ext2/namei.c
@@ -97,7 +97,7 @@ struct dentry *ext2_get_parent(struct dentry *child)
* If the create succeeds, we fill in the inode information
* with d_instantiate().
*/
-static int ext2_create (struct mnt_idmap * idmap,
+static int ext2_create (const struct mnt_idmap * idmap,
struct inode * dir, struct dentry * dentry,
umode_t mode)
{