Skip to content

Commit 808d4e3

Browse files
author
Al Viro
committed
consitify do_mount() arguments
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 4b2c551 commit 808d4e3

10 files changed

Lines changed: 27 additions & 26 deletions

File tree

‎fs/namespace.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ static int do_change_type(struct path *path, int flag)
16401640
/*
16411641
* do loopback mount.
16421642
*/
1643-
static int do_loopback(struct path *path, char *old_name,
1643+
static int do_loopback(struct path *path, const char *old_name,
16441644
int recurse)
16451645
{
16461646
LIST_HEAD(umount_list);
@@ -1764,7 +1764,7 @@ static inline int tree_contains_unbindable(struct mount *mnt)
17641764
return 0;
17651765
}
17661766

1767-
static int do_move_mount(struct path *path, char *old_name)
1767+
static int do_move_mount(struct path *path, const char *old_name)
17681768
{
17691769
struct path old_path, parent_path;
17701770
struct mount *p;
@@ -1917,8 +1917,8 @@ static int do_add_mount(struct mount *newmnt, struct path *path, int mnt_flags)
19171917
* create a new mount for userspace and request it to be added into the
19181918
* namespace's tree
19191919
*/
1920-
static int do_new_mount(struct path *path, char *type, int flags,
1921-
int mnt_flags, char *name, void *data)
1920+
static int do_new_mount(struct path *path, const char *type, int flags,
1921+
int mnt_flags, const char *name, void *data)
19221922
{
19231923
struct vfsmount *mnt;
19241924
int err;
@@ -2191,8 +2191,8 @@ int copy_mount_string(const void __user *data, char **where)
21912191
* Therefore, if this magic number is present, it carries no information
21922192
* and must be discarded.
21932193
*/
2194-
long do_mount(char *dev_name, char *dir_name, char *type_page,
2195-
unsigned long flags, void *data_page)
2194+
long do_mount(const char *dev_name, const char *dir_name,
2195+
const char *type_page, unsigned long flags, void *data_page)
21962196
{
21972197
struct path path;
21982198
int retval = 0;

‎include/linux/fs.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2075,7 +2075,7 @@ extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data);
20752075
extern void kern_unmount(struct vfsmount *mnt);
20762076
extern int may_umount_tree(struct vfsmount *);
20772077
extern int may_umount(struct vfsmount *);
2078-
extern long do_mount(char *, char *, char *, unsigned long, void *);
2078+
extern long do_mount(const char *, const char *, const char *, unsigned long, void *);
20792079
extern struct vfsmount *collect_mounts(struct path *);
20802080
extern void drop_collected_mounts(struct vfsmount *);
20812081
extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *,

‎include/linux/security.h‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,8 +1411,8 @@ struct security_operations {
14111411
int (*sb_kern_mount) (struct super_block *sb, int flags, void *data);
14121412
int (*sb_show_options) (struct seq_file *m, struct super_block *sb);
14131413
int (*sb_statfs) (struct dentry *dentry);
1414-
int (*sb_mount) (char *dev_name, struct path *path,
1415-
char *type, unsigned long flags, void *data);
1414+
int (*sb_mount) (const char *dev_name, struct path *path,
1415+
const char *type, unsigned long flags, void *data);
14161416
int (*sb_umount) (struct vfsmount *mnt, int flags);
14171417
int (*sb_pivotroot) (struct path *old_path,
14181418
struct path *new_path);
@@ -1694,8 +1694,8 @@ int security_sb_remount(struct super_block *sb, void *data);
16941694
int security_sb_kern_mount(struct super_block *sb, int flags, void *data);
16951695
int security_sb_show_options(struct seq_file *m, struct super_block *sb);
16961696
int security_sb_statfs(struct dentry *dentry);
1697-
int security_sb_mount(char *dev_name, struct path *path,
1698-
char *type, unsigned long flags, void *data);
1697+
int security_sb_mount(const char *dev_name, struct path *path,
1698+
const char *type, unsigned long flags, void *data);
16991699
int security_sb_umount(struct vfsmount *mnt, int flags);
17001700
int security_sb_pivotroot(struct path *old_path, struct path *new_path);
17011701
int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts);
@@ -1964,8 +1964,8 @@ static inline int security_sb_statfs(struct dentry *dentry)
19641964
return 0;
19651965
}
19661966

1967-
static inline int security_sb_mount(char *dev_name, struct path *path,
1968-
char *type, unsigned long flags,
1967+
static inline int security_sb_mount(const char *dev_name, struct path *path,
1968+
const char *type, unsigned long flags,
19691969
void *data)
19701970
{
19711971
return 0;

‎security/capability.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ static int cap_sb_statfs(struct dentry *dentry)
7474
return 0;
7575
}
7676

77-
static int cap_sb_mount(char *dev_name, struct path *path, char *type,
78-
unsigned long flags, void *data)
77+
static int cap_sb_mount(const char *dev_name, struct path *path,
78+
const char *type, unsigned long flags, void *data)
7979
{
8080
return 0;
8181
}

‎security/security.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ int security_sb_statfs(struct dentry *dentry)
276276
return security_ops->sb_statfs(dentry);
277277
}
278278

279-
int security_sb_mount(char *dev_name, struct path *path,
280-
char *type, unsigned long flags, void *data)
279+
int security_sb_mount(const char *dev_name, struct path *path,
280+
const char *type, unsigned long flags, void *data)
281281
{
282282
return security_ops->sb_mount(dev_name, path, type, flags, data);
283283
}

‎security/selinux/hooks.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2452,9 +2452,9 @@ static int selinux_sb_statfs(struct dentry *dentry)
24522452
return superblock_has_perm(cred, dentry->d_sb, FILESYSTEM__GETATTR, &ad);
24532453
}
24542454

2455-
static int selinux_mount(char *dev_name,
2455+
static int selinux_mount(const char *dev_name,
24562456
struct path *path,
2457-
char *type,
2457+
const char *type,
24582458
unsigned long flags,
24592459
void *data)
24602460
{

‎security/smack/smack_lsm.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,8 @@ static int smack_sb_statfs(struct dentry *dentry)
408408
* Returns 0 if current can write the floor of the filesystem
409409
* being mounted on, an error code otherwise.
410410
*/
411-
static int smack_sb_mount(char *dev_name, struct path *path,
412-
char *type, unsigned long flags, void *data)
411+
static int smack_sb_mount(const char *dev_name, struct path *path,
412+
const char *type, unsigned long flags, void *data)
413413
{
414414
struct superblock_smack *sbp = path->dentry->d_sb->s_security;
415415
struct smk_audit_info ad;

‎security/tomoyo/common.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ int tomoyo_init_request_info(struct tomoyo_request_info *r,
970970
const u8 index);
971971
int tomoyo_mkdev_perm(const u8 operation, struct path *path,
972972
const unsigned int mode, unsigned int dev);
973-
int tomoyo_mount_permission(char *dev_name, struct path *path,
973+
int tomoyo_mount_permission(const char *dev_name, struct path *path,
974974
const char *type, unsigned long flags,
975975
void *data_page);
976976
int tomoyo_open_control(const u8 type, struct file *file);

‎security/tomoyo/mount.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ static bool tomoyo_check_mount_acl(struct tomoyo_request_info *r,
7171
*
7272
* Caller holds tomoyo_read_lock().
7373
*/
74-
static int tomoyo_mount_acl(struct tomoyo_request_info *r, char *dev_name,
74+
static int tomoyo_mount_acl(struct tomoyo_request_info *r,
75+
const char *dev_name,
7576
struct path *dir, const char *type,
7677
unsigned long flags)
7778
{
@@ -183,7 +184,7 @@ static int tomoyo_mount_acl(struct tomoyo_request_info *r, char *dev_name,
183184
*
184185
* Returns 0 on success, negative value otherwise.
185186
*/
186-
int tomoyo_mount_permission(char *dev_name, struct path *path,
187+
int tomoyo_mount_permission(const char *dev_name, struct path *path,
187188
const char *type, unsigned long flags,
188189
void *data_page)
189190
{

‎security/tomoyo/tomoyo.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,8 @@ static int tomoyo_path_chroot(struct path *path)
408408
*
409409
* Returns 0 on success, negative value otherwise.
410410
*/
411-
static int tomoyo_sb_mount(char *dev_name, struct path *path,
412-
char *type, unsigned long flags, void *data)
411+
static int tomoyo_sb_mount(const char *dev_name, struct path *path,
412+
const char *type, unsigned long flags, void *data)
413413
{
414414
return tomoyo_mount_permission(dev_name, path, type, flags, data);
415415
}

0 commit comments

Comments
 (0)