X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=fs%2Fsysfs%2Fmount.c;h=49749955ccafe8b9f4b6dd4393ed5a3a2f92037e;hb=fc2e3180a714d3125fc883541c0cd5936c99ba34;hp=ab343e371d64682f678646ed02615171e73b2d31;hpb=55fa518867978e1f5fd8353098f80d125ac734d7;p=karo-tx-linux.git diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c index ab343e371d64..49749955ccaf 100644 --- a/fs/sysfs/mount.c +++ b/fs/sysfs/mount.c @@ -17,11 +17,10 @@ #include #include #include +#include #include "sysfs.h" -/* Random magic number */ -#define SYSFS_MAGIC 0x62656572 static struct vfsmount *sysfs_mount; struct super_block * sysfs_sb = NULL; @@ -30,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 = { @@ -53,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;