]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/sysfs/mount.c
sysfs: Move all of inode initialization into sysfs_init_inode
[linux-2.6-omap-h63xx.git] / fs / sysfs / mount.c
index 402cc356203c9ac89f3325f320be5f5c5026312f..92f407fb1263de1dd0c4d867e6e6cc82b1b70c48 100644 (file)
@@ -8,7 +8,6 @@
 #include <linux/mount.h>
 #include <linux/pagemap.h>
 #include <linux/init.h>
-#include <asm/semaphore.h>
 
 #include "sysfs.h"
 
@@ -21,7 +20,7 @@ struct kmem_cache *sysfs_dir_cachep;
 
 static const struct super_operations sysfs_ops = {
        .statfs         = simple_statfs,
-       .drop_inode     = sysfs_delete_inode,
+       .drop_inode     = generic_delete_inode,
 };
 
 struct sysfs_dirent sysfs_root = {
@@ -43,19 +42,14 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent)
        sb->s_time_gran = 1;
        sysfs_sb = sb;
 
-       inode = new_inode(sysfs_sb);
+       /* get root inode, initialize and unlock it */
+       inode = sysfs_get_inode(&sysfs_root);
        if (!inode) {
                pr_debug("sysfs: could not get root inode\n");
                return -ENOMEM;
        }
 
-       sysfs_init_inode(&sysfs_root, inode);
-
-       inode->i_op = &sysfs_dir_inode_operations;
-       inode->i_fop = &sysfs_dir_operations;
-       /* directory inodes start off with i_nlink == 2 (for "." entry) */
-       inc_nlink(inode);
-
+       /* instantiate and link root dentry */
        root = d_alloc_root(inode);
        if (!root) {
                pr_debug("%s: could not get root dentry!\n",__FUNCTION__);
@@ -86,7 +80,7 @@ int __init sysfs_init(void)
 
        sysfs_dir_cachep = kmem_cache_create("sysfs_dir_cache",
                                              sizeof(struct sysfs_dirent),
-                                             0, 0, NULL, NULL);
+                                             0, 0, NULL);
        if (!sysfs_dir_cachep)
                goto out;