]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
vfs: misc struct path constification
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 21 Nov 2016 01:27:12 +0000 (20:27 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 6 Dec 2016 00:03:49 +0000 (19:03 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c
fs/statfs.c
fs/utimes.c
include/linux/fs.h

index 5b4eed2215304a14ac2614058ae2b2002a3f2ae9..1c8f4386b03f752ea0740a4c89c111dc2694832c 100644 (file)
@@ -2895,7 +2895,7 @@ bool may_open_dev(const struct path *path)
                !(path->mnt->mnt_sb->s_iflags & SB_I_NODEV);
 }
 
-static int may_open(struct path *path, int acc_mode, int flag)
+static int may_open(const struct path *path, int acc_mode, int flag)
 {
        struct dentry *dentry = path->dentry;
        struct inode *inode = dentry->d_inode;
@@ -2945,7 +2945,7 @@ static int may_open(struct path *path, int acc_mode, int flag)
 
 static int handle_truncate(struct file *filp)
 {
-       struct path *path = &filp->f_path;
+       const struct path *path = &filp->f_path;
        struct inode *inode = path->dentry->d_inode;
        int error = get_write_access(inode);
        if (error)
index 083dc0ac91408870254cac60ed4b06580deba610..13ae259d48795a782e566b7deaceadc73f86d8c7 100644 (file)
@@ -63,7 +63,7 @@ static int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf)
        return retval;
 }
 
-int vfs_statfs(struct path *path, struct kstatfs *buf)
+int vfs_statfs(const struct path *path, struct kstatfs *buf)
 {
        int error;
 
index 22307cdf7014ba84887a036356deb54fe235d13d..5fdb505e307c5bf754a09a0ba06274169e45a31b 100644 (file)
@@ -48,7 +48,7 @@ static bool nsec_valid(long nsec)
        return nsec >= 0 && nsec <= 999999999;
 }
 
-static int utimes_common(struct path *path, struct timespec *times)
+static int utimes_common(const struct path *path, struct timespec *times)
 {
        int error;
        struct iattr newattrs;
index 3056fe46f336a93786a01ebd099f74abf5e07114..0e177d395efbf5940639aab175a6ba87a53fe1dc 100644 (file)
@@ -2127,7 +2127,7 @@ extern struct vfsmount *collect_mounts(const struct path *);
 extern void drop_collected_mounts(struct vfsmount *);
 extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *,
                          struct vfsmount *);
-extern int vfs_statfs(struct path *, struct kstatfs *);
+extern int vfs_statfs(const struct path *, struct kstatfs *);
 extern int user_statfs(const char __user *, struct kstatfs *);
 extern int fd_statfs(int, struct kstatfs *);
 extern int vfs_ustat(dev_t, struct kstatfs *);