X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=fs%2Fsysfs%2Fmount.c;h=74168266cd59a1abca9e8039131c0ce46b240980;hb=26808d3f10b1213bbb6e27d441be40e20ab84611;hp=ac7625631fcfc0f5ae369a998b49804d1c961fe6;hpb=0333cd8a3f4249fde2c50929a6eac35245fc685b;p=powerpc.git diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c index ac7625631f..74168266cd 100644 --- a/fs/sysfs/mount.c +++ b/fs/sysfs/mount.c @@ -1,5 +1,13 @@ /* - * mount.c - operations for initializing and mounting sysfs. + * fs/sysfs/symlink.c - operations for initializing and mounting sysfs + * + * Copyright (c) 2001-3 Patrick Mochel + * Copyright (c) 2007 SUSE Linux Products GmbH + * Copyright (c) 2007 Tejun Heo + * + * This file is released under the GPLv2. + * + * Please see Documentation/filesystems/sysfs.txt for more information. */ #define DEBUG @@ -14,7 +22,7 @@ /* Random magic number */ #define SYSFS_MAGIC 0x62656572 -struct vfsmount *sysfs_mount; +static struct vfsmount *sysfs_mount; struct super_block * sysfs_sb = NULL; struct kmem_cache *sysfs_dir_cachep; @@ -24,8 +32,9 @@ static const struct super_operations sysfs_ops = { }; struct sysfs_dirent sysfs_root = { + .s_name = "", .s_count = ATOMIC_INIT(1), - .s_flags = SYSFS_ROOT, + .s_flags = SYSFS_DIR, .s_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO, .s_ino = 1, }; @@ -56,7 +65,6 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent) iput(inode); return -ENOMEM; } - sysfs_root.s_dentry = root; root->d_fsdata = &sysfs_root; sb->s_root = root; return 0; @@ -84,6 +92,10 @@ int __init sysfs_init(void) if (!sysfs_dir_cachep) goto out; + err = sysfs_inode_init(); + if (err) + goto out_err; + err = register_filesystem(&sysfs_fs_type); if (!err) { sysfs_mount = kern_mount(&sysfs_fs_type);