Skip to content

Commit 51a35e9

Browse files
htejungregkh
authored andcommitted
sysfs, kernfs: make sysfs_super_info->ns const
Add const qualifier to sysfs_super_info->ns so that it's consistent with other namespace tag usages in sysfs. Because kobject doesn't use const qualifier for namespace tags, this ends up requiring an explicit cast to drop const qualifier in free_sysfs_super_info(). Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ccc532d commit 51a35e9

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎fs/sysfs/mount.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static int sysfs_set_super(struct super_block *sb, void *data)
9292

9393
static void free_sysfs_super_info(struct sysfs_super_info *info)
9494
{
95-
kobj_ns_drop(KOBJ_NS_TYPE_NET, info->ns);
95+
kobj_ns_drop(KOBJ_NS_TYPE_NET, (void *)info->ns);
9696
kfree(info);
9797
}
9898

‎fs/sysfs/sysfs.h‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
* mount.c
1919
*/
2020

21-
/*
22-
* Each sb is associated with one namespace tag, currently the network
23-
* namespace of the task which mounted this sysfs instance. If multiple
24-
* tags become necessary, make the following an array and compare
25-
* sysfs_dirent tag against every entry.
26-
*/
2721
struct sysfs_super_info {
28-
void *ns;
22+
/*
23+
* Each sb is associated with one namespace tag, currently the network
24+
* namespace of the task which mounted this sysfs instance. If multiple
25+
* tags become necessary, make the following an array and compare
26+
* sysfs_dirent tag against every entry.
27+
*/
28+
const void *ns;
2929
};
3030
#define sysfs_info(SB) ((struct sysfs_super_info *)(SB->s_fs_info))
3131
extern struct sysfs_dirent sysfs_root;

0 commit comments

Comments
 (0)