Skip to content

Commit

Permalink
sysfs, kernfs: make sysfs_super_info->ns const
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tejun Heo authored and Greg Kroah-Hartman committed Nov 30, 2013
1 parent ccc532d commit 51a35e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion fs/sysfs/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static int sysfs_set_super(struct super_block *sb, void *data)

static void free_sysfs_super_info(struct sysfs_super_info *info)
{
kobj_ns_drop(KOBJ_NS_TYPE_NET, info->ns);
kobj_ns_drop(KOBJ_NS_TYPE_NET, (void *)info->ns);
kfree(info);
}

Expand Down
14 changes: 7 additions & 7 deletions fs/sysfs/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
* mount.c
*/

/*
* Each sb is associated with one namespace tag, currently the network
* namespace of the task which mounted this sysfs instance. If multiple
* tags become necessary, make the following an array and compare
* sysfs_dirent tag against every entry.
*/
struct sysfs_super_info {
void *ns;
/*
* Each sb is associated with one namespace tag, currently the network
* namespace of the task which mounted this sysfs instance. If multiple
* tags become necessary, make the following an array and compare
* sysfs_dirent tag against every entry.
*/
const void *ns;
};
#define sysfs_info(SB) ((struct sysfs_super_info *)(SB->s_fs_info))
extern struct sysfs_dirent sysfs_root;
Expand Down

0 comments on commit 51a35e9

Please sign in to comment.