]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
afs_edit_dir_{add,remove}(): constify qstr argument
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 5 Feb 2024 02:39:50 +0000 (21:39 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 16 Sep 2025 01:08:33 +0000 (21:08 -0400)
Nothing outside of fs/dcache.c has any business modifying
dentry names; passing &dentry->d_name as an argument should
have that argument declared as a const pointer.

Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/afs/dir_edit.c
fs/afs/internal.h

index 60a549f1d9c5fdb53866da160a7c672a5aa6afc7..60b0f70f63a382536e387099613681ae2691a1d5 100644 (file)
@@ -239,7 +239,7 @@ static void afs_edit_init_block(union afs_xdr_dir_block *meta,
  * The caller must hold the inode locked.
  */
 void afs_edit_dir_add(struct afs_vnode *vnode,
-                     struct qstr *name, struct afs_fid *new_fid,
+                     const struct qstr *name, struct afs_fid *new_fid,
                      enum afs_edit_dir_reason why)
 {
        union afs_xdr_dir_block *meta, *block;
@@ -391,7 +391,7 @@ error:
  * The caller must hold the inode locked.
  */
 void afs_edit_dir_remove(struct afs_vnode *vnode,
-                        struct qstr *name, enum afs_edit_dir_reason why)
+                        const struct qstr *name, enum afs_edit_dir_reason why)
 {
        union afs_xdr_dir_block *meta, *block, *pblock;
        union afs_xdr_dirent *de, *pde;
index 1124ea4000cb1bf50dc379bde6ffe6e93b812578..db14882d367b6bcbdbbebd45c30d022afc037770 100644 (file)
@@ -1097,9 +1097,9 @@ int afs_single_writepages(struct address_space *mapping,
 /*
  * dir_edit.c
  */
-extern void afs_edit_dir_add(struct afs_vnode *, struct qstr *, struct afs_fid *,
+extern void afs_edit_dir_add(struct afs_vnode *, const struct qstr *, struct afs_fid *,
                             enum afs_edit_dir_reason);
-extern void afs_edit_dir_remove(struct afs_vnode *, struct qstr *, enum afs_edit_dir_reason);
+extern void afs_edit_dir_remove(struct afs_vnode *, const struct qstr *, enum afs_edit_dir_reason);
 void afs_edit_dir_update_dotdot(struct afs_vnode *vnode, struct afs_vnode *new_dvnode,
                                enum afs_edit_dir_reason why);
 void afs_mkdir_init_dir(struct afs_vnode *dvnode, struct afs_vnode *parent_vnode);