aboutsummaryrefslogtreecommitdiffstats
path: root/fs/kernfs
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-11-28 14:54:43 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-29 21:16:08 -0500
commit4b93dc9b1c684d0587fe44d36bbfdf45bd3bea9d (patch)
tree99a8124d0407511d6193e286b1a5b6e7d5aafdb2 /fs/kernfs
parentdf394fb56c64244b30b442e9e02de1a2d9c5a98b (diff)
sysfs, kernfs: prepare mount path for kernfs
We're in the process of separating out core sysfs functionality into kernfs which will deal with sysfs_dirents directly. This patch rearranges mount path so that the kernfs and sysfs parts are separate. * As sysfs_super_info won't be visible outside kernfs proper, kernfs_super_ns() is added to allow kernfs users to access a super_block's namespace tag. * Generic mount operation is separated out into kernfs_mount_ns(). sysfs_mount() now just performs sysfs-specific permission check, acquires namespace tag, and invokes kernfs_mount_ns(). * Generic superblock release is separated out into kernfs_kill_sb() which can be used directly as file_system_type->kill_sb(). As sysfs needs to put the namespace tag, sysfs_kill_sb() wraps kernfs_kill_sb() with ns tag put. * sysfs_dir_cachep init and sysfs_inode_init() are separated out into kernfs_init(). kernfs_init() uses only small amount of memory and trying to handle and propagate kernfs_init() failure doesn't make much sense. Use SLAB_PANIC for sysfs_dir_cachep and make sysfs_inode_init() panic on failure. After this change, kernfs_init() should be called before sysfs_init(), fs/namespace.c::mnt_init() modified accordingly. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: linux-fsdevel@vger.kernel.org Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/kernfs')
-rw-r--r--fs/kernfs/inode.c5
-rw-r--r--fs/kernfs/kernfs-internal.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/fs/kernfs/inode.c b/fs/kernfs/inode.c
index 9d4fab49ea20..b4cae6fd717b 100644
--- a/fs/kernfs/inode.c
+++ b/fs/kernfs/inode.c
@@ -37,9 +37,10 @@ static const struct inode_operations sysfs_inode_operations = {
37 .setxattr = sysfs_setxattr, 37 .setxattr = sysfs_setxattr,
38}; 38};
39 39
40int __init sysfs_inode_init(void) 40void __init sysfs_inode_init(void)
41{ 41{
42 return bdi_init(&sysfs_backing_dev_info); 42 if (bdi_init(&sysfs_backing_dev_info))
43 panic("failed to init sysfs_backing_dev_info");
43} 44}
44 45
45static struct sysfs_inode_attrs *sysfs_init_inode_attrs(struct sysfs_dirent *sd) 46static struct sysfs_inode_attrs *sysfs_init_inode_attrs(struct sysfs_dirent *sd)
diff --git a/fs/kernfs/kernfs-internal.h b/fs/kernfs/kernfs-internal.h
index 466943d576f1..0d949885389d 100644
--- a/fs/kernfs/kernfs-internal.h
+++ b/fs/kernfs/kernfs-internal.h
@@ -144,7 +144,7 @@ int sysfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
144 struct kstat *stat); 144 struct kstat *stat);
145int sysfs_setxattr(struct dentry *dentry, const char *name, const void *value, 145int sysfs_setxattr(struct dentry *dentry, const char *name, const void *value,
146 size_t size, int flags); 146 size_t size, int flags);
147int sysfs_inode_init(void); 147void sysfs_inode_init(void);
148 148
149/* 149/*
150 * dir.c 150 * dir.c