Skip to content

Commit dcf787f

Browse files
author
Al Viro
committed
constify path_get/path_put and fs_struct.c stuff
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 26567cd commit dcf787f

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎fs/fs_struct.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Replace the fs->{rootmnt,root} with {mnt,dentry}. Put the old values.
1111
* It can block.
1212
*/
13-
void set_fs_root(struct fs_struct *fs, struct path *path)
13+
void set_fs_root(struct fs_struct *fs, const struct path *path)
1414
{
1515
struct path old_root;
1616

@@ -29,7 +29,7 @@ void set_fs_root(struct fs_struct *fs, struct path *path)
2929
* Replace the fs->{pwdmnt,pwd} with {mnt,dentry}. Put the old values.
3030
* It can block.
3131
*/
32-
void set_fs_pwd(struct fs_struct *fs, struct path *path)
32+
void set_fs_pwd(struct fs_struct *fs, const struct path *path)
3333
{
3434
struct path old_pwd;
3535

@@ -53,7 +53,7 @@ static inline int replace_path(struct path *p, const struct path *old, const str
5353
return 1;
5454
}
5555

56-
void chroot_fs_refs(struct path *old_root, struct path *new_root)
56+
void chroot_fs_refs(const struct path *old_root, const struct path *new_root)
5757
{
5858
struct task_struct *g, *p;
5959
struct fs_struct *fs;

‎fs/internal.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ extern void __mnt_drop_write_file(struct file *);
6969
/*
7070
* fs_struct.c
7171
*/
72-
extern void chroot_fs_refs(struct path *, struct path *);
72+
extern void chroot_fs_refs(const struct path *, const struct path *);
7373

7474
/*
7575
* file_table.c

‎fs/namei.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ int inode_permission(struct inode *inode, int mask)
451451
*
452452
* Given a path increment the reference count to the dentry and the vfsmount.
453453
*/
454-
void path_get(struct path *path)
454+
void path_get(const struct path *path)
455455
{
456456
mntget(path->mnt);
457457
dget(path->dentry);
@@ -464,7 +464,7 @@ EXPORT_SYMBOL(path_get);
464464
*
465465
* Given a path decrement the reference count to the dentry and the vfsmount.
466466
*/
467-
void path_put(struct path *path)
467+
void path_put(const struct path *path)
468468
{
469469
dput(path->dentry);
470470
mntput(path->mnt);

‎include/linux/fs_struct.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ struct fs_struct {
1717
extern struct kmem_cache *fs_cachep;
1818

1919
extern void exit_fs(struct task_struct *);
20-
extern void set_fs_root(struct fs_struct *, struct path *);
21-
extern void set_fs_pwd(struct fs_struct *, struct path *);
20+
extern void set_fs_root(struct fs_struct *, const struct path *);
21+
extern void set_fs_pwd(struct fs_struct *, const struct path *);
2222
extern struct fs_struct *copy_fs_struct(struct fs_struct *);
2323
extern void free_fs_struct(struct fs_struct *);
2424
extern int unshare_fs_struct(void);

‎include/linux/path.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ struct path {
99
struct dentry *dentry;
1010
};
1111

12-
extern void path_get(struct path *);
13-
extern void path_put(struct path *);
12+
extern void path_get(const struct path *);
13+
extern void path_put(const struct path *);
1414

1515
static inline int path_equal(const struct path *path1, const struct path *path2)
1616
{

0 commit comments

Comments
 (0)