aboutsummaryrefslogtreecommitdiffstats
path: root/fs/kernfs
diff options
context:
space:
mode:
authorJianyu Zhan <nasa4836@gmail.com>2014-04-26 03:40:28 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-27 17:33:17 -0400
commit26fc9cd200ec839e0b3095e05ae018f27314e7aa (patch)
tree26929ec0f651c6ddaac58cd8061f4a9644440a86 /fs/kernfs
parent9f70a40128a4ddceffb6d21dd490f6ab4bc34c97 (diff)
kernfs: move the last knowledge of sysfs out from kernfs
There is still one residue of sysfs remaining: the sb_magic SYSFS_MAGIC. However this should be kernfs user specific, so this patch moves it out. Kerrnfs user should specify their magic number while mouting. Signed-off-by: Jianyu Zhan <nasa4836@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/kernfs')
-rw-r--r--fs/kernfs/mount.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c
index f25a7c0c3cdc..d171b98a6cdd 100644
--- a/fs/kernfs/mount.c
+++ b/fs/kernfs/mount.c
@@ -62,7 +62,7 @@ struct kernfs_root *kernfs_root_from_sb(struct super_block *sb)
62 return NULL; 62 return NULL;
63} 63}
64 64
65static int kernfs_fill_super(struct super_block *sb) 65static int kernfs_fill_super(struct super_block *sb, unsigned long magic)
66{ 66{
67 struct kernfs_super_info *info = kernfs_info(sb); 67 struct kernfs_super_info *info = kernfs_info(sb);
68 struct inode *inode; 68 struct inode *inode;
@@ -71,7 +71,7 @@ static int kernfs_fill_super(struct super_block *sb)
71 info->sb = sb; 71 info->sb = sb;
72 sb->s_blocksize = PAGE_CACHE_SIZE; 72 sb->s_blocksize = PAGE_CACHE_SIZE;
73 sb->s_blocksize_bits = PAGE_CACHE_SHIFT; 73 sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
74 sb->s_magic = SYSFS_MAGIC; 74 sb->s_magic = magic;
75 sb->s_op = &kernfs_sops; 75 sb->s_op = &kernfs_sops;
76 sb->s_time_gran = 1; 76 sb->s_time_gran = 1;
77 77
@@ -132,6 +132,7 @@ const void *kernfs_super_ns(struct super_block *sb)
132 * @fs_type: file_system_type of the fs being mounted 132 * @fs_type: file_system_type of the fs being mounted
133 * @flags: mount flags specified for the mount 133 * @flags: mount flags specified for the mount
134 * @root: kernfs_root of the hierarchy being mounted 134 * @root: kernfs_root of the hierarchy being mounted
135 * @magic: file system specific magic number
135 * @new_sb_created: tell the caller if we allocated a new superblock 136 * @new_sb_created: tell the caller if we allocated a new superblock
136 * @ns: optional namespace tag of the mount 137 * @ns: optional namespace tag of the mount
137 * 138 *
@@ -143,8 +144,8 @@ const void *kernfs_super_ns(struct super_block *sb)
143 * The return value can be passed to the vfs layer verbatim. 144 * The return value can be passed to the vfs layer verbatim.
144 */ 145 */
145struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags, 146struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags,
146 struct kernfs_root *root, bool *new_sb_created, 147 struct kernfs_root *root, unsigned long magic,
147 const void *ns) 148 bool *new_sb_created, const void *ns)
148{ 149{
149 struct super_block *sb; 150 struct super_block *sb;
150 struct kernfs_super_info *info; 151 struct kernfs_super_info *info;
@@ -169,7 +170,7 @@ struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags,
169 if (!sb->s_root) { 170 if (!sb->s_root) {
170 struct kernfs_super_info *info = kernfs_info(sb); 171 struct kernfs_super_info *info = kernfs_info(sb);
171 172
172 error = kernfs_fill_super(sb); 173 error = kernfs_fill_super(sb, magic);
173 if (error) { 174 if (error) {
174 deactivate_locked_super(sb); 175 deactivate_locked_super(sb);
175 return ERR_PTR(error); 176 return ERR_PTR(error);