]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/sysfs/mount.c
Merge branch 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / fs / sysfs / mount.c
index 14f0023984d74d6a51dedc0791fdfab53f2d5cc4..49749955ccafe8b9f4b6dd4393ed5a3a2f92037e 100644 (file)
 #include <linux/mount.h>
 #include <linux/pagemap.h>
 #include <linux/init.h>
+#include <linux/module.h>
+#include <linux/magic.h>
 
 #include "sysfs.h"
 
-/* Random magic number */
-#define SYSFS_MAGIC 0x62656572
 
 static struct vfsmount *sysfs_mount;
 struct super_block * sysfs_sb = NULL;
@@ -29,6 +29,7 @@ struct kmem_cache *sysfs_dir_cachep;
 static const struct super_operations sysfs_ops = {
        .statfs         = simple_statfs,
        .drop_inode     = generic_delete_inode,
+       .delete_inode   = sysfs_delete_inode,
 };
 
 struct sysfs_dirent sysfs_root = {
@@ -52,7 +53,9 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent)
        sysfs_sb = sb;
 
        /* get root inode, initialize and unlock it */
+       mutex_lock(&sysfs_mutex);
        inode = sysfs_get_inode(&sysfs_root);
+       mutex_unlock(&sysfs_mutex);
        if (!inode) {
                pr_debug("sysfs: could not get root inode\n");
                return -ENOMEM;
@@ -115,3 +118,17 @@ out_err:
        sysfs_dir_cachep = NULL;
        goto out;
 }
+
+#undef sysfs_get
+struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd)
+{
+       return __sysfs_get(sd);
+}
+EXPORT_SYMBOL_GPL(sysfs_get);
+
+#undef sysfs_put
+void sysfs_put(struct sysfs_dirent *sd)
+{
+       __sysfs_put(sd);
+}
+EXPORT_SYMBOL_GPL(sysfs_put);