ecryptfs: constify path
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 4 Aug 2022 17:24:00 +0000 (13:24 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 1 Sep 2022 21:40:38 +0000 (17:40 -0400)
Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/file.c
fs/ecryptfs/inode.c
fs/ecryptfs/main.c

index 5f2b49e13731a2919ca0a168790e235b16c48935..f2ed0c0266cb7d455b95f9d453737bc4222f1804 100644 (file)
@@ -506,7 +506,7 @@ ecryptfs_dentry_to_lower(struct dentry *dentry)
        return ((struct ecryptfs_dentry_info *)dentry->d_fsdata)->lower_path.dentry;
 }
 
-static inline struct path *
+static inline const struct path *
 ecryptfs_dentry_to_lower_path(struct dentry *dentry)
 {
        return &((struct ecryptfs_dentry_info *)dentry->d_fsdata)->lower_path;
index 18d5b91cb573edc34e4e3e8876911b14c6c2fe76..195f7c2a16e801772279803a80c2a4fce7665ca0 100644 (file)
@@ -33,7 +33,7 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb,
                                struct iov_iter *to)
 {
        ssize_t rc;
-       struct path *path;
+       const struct path *path;
        struct file *file = iocb->ki_filp;
 
        rc = generic_file_read_iter(iocb, to);
index 16d50dface59abfc03ed0899f91a1b40ac8dd5d2..c214fe0981bdc333f1fdd75a47ef7454d971d2c7 100644 (file)
@@ -317,7 +317,7 @@ static int ecryptfs_i_size_read(struct dentry *dentry, struct inode *inode)
 static struct dentry *ecryptfs_lookup_interpose(struct dentry *dentry,
                                     struct dentry *lower_dentry)
 {
-       struct path *path = ecryptfs_dentry_to_lower_path(dentry->d_parent);
+       const struct path *path = ecryptfs_dentry_to_lower_path(dentry->d_parent);
        struct inode *inode, *lower_inode;
        struct ecryptfs_dentry_info *dentry_info;
        int rc = 0;
index 2dd23a82e0de56165f10a51e990ffd2a1d2321d6..2dc927ba067fec4f05b5a78f08fa702457d2ef75 100644 (file)
@@ -105,7 +105,7 @@ static int ecryptfs_init_lower_file(struct dentry *dentry,
                                    struct file **lower_file)
 {
        const struct cred *cred = current_cred();
-       struct path *path = ecryptfs_dentry_to_lower_path(dentry);
+       const struct path *path = ecryptfs_dentry_to_lower_path(dentry);
        int rc;
 
        rc = ecryptfs_privileged_open(lower_file, path->dentry, path->mnt,