X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=fs%2Fsysfs%2Fmount.c;h=92f407fb1263de1dd0c4d867e6e6cc82b1b70c48;hb=119dd52be33dfe6285f586ab7354897fdefc7e23;hp=078537e5d69696756fc102b3fedb9d6987d9fbe5;hpb=b402d72cf7b338a074e3c12b305ec79284e18845;p=linux-2.6-omap-h63xx.git diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c index 078537e5d69..92f407fb126 100644 --- a/fs/sysfs/mount.c +++ b/fs/sysfs/mount.c @@ -8,7 +8,6 @@ #include #include #include -#include #include "sysfs.h" @@ -21,10 +20,10 @@ 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, }; -static struct sysfs_dirent sysfs_root = { +struct sysfs_dirent sysfs_root = { .s_count = ATOMIC_INIT(1), .s_flags = SYSFS_ROOT, .s_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO, @@ -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;