]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/sysfs/mount.c
kernel-doc: detect/prevent duplicate doc section names
[linux-2.6-omap-h63xx.git] / fs / sysfs / mount.c
index fbc7b65fe26267d776a105f5d37f01627edf44a2..74168266cd59a1abca9e8039131c0ce46b240980 100644 (file)
@@ -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 <teheo@suse.de>
+ *
+ * This file is released under the GPLv2.
+ *
+ * Please see Documentation/filesystems/sysfs.txt for more information.
  */
 
 #define DEBUG 
 #include <linux/mount.h>
 #include <linux/pagemap.h>
 #include <linux/init.h>
-#include <asm/semaphore.h>
 
 #include "sysfs.h"
 
 /* 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;
 
 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 = {
+       .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,
 };
@@ -50,11 +58,6 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent)
                return -ENOMEM;
        }
 
-       inode->i_op = &sysfs_dir_inode_operations;
-       inode->i_fop = &sysfs_dir_operations;
-       inc_nlink(inode); /* directory, account for "." */
-       unlock_new_inode(inode);
-
        /* instantiate and link root dentry */
        root = d_alloc_root(inode);
        if (!root) {
@@ -62,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;
@@ -77,7 +79,7 @@ static int sysfs_get_sb(struct file_system_type *fs_type,
 static struct file_system_type sysfs_fs_type = {
        .name           = "sysfs",
        .get_sb         = sysfs_get_sb,
-       .kill_sb        = kill_litter_super,
+       .kill_sb        = kill_anon_super,
 };
 
 int __init sysfs_init(void)
@@ -90,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);