diff options
Diffstat (limited to 'fs/sysfs')
-rw-r--r-- | fs/sysfs/dir.c | 7 | ||||
-rw-r--r-- | fs/sysfs/inode.c | 5 | ||||
-rw-r--r-- | fs/sysfs/mount.c | 4 | ||||
-rw-r--r-- | fs/sysfs/sysfs.h | 1 |
4 files changed, 13 insertions, 4 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 9161db4d6b5c..7a8ce9e98b32 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c @@ -24,9 +24,9 @@ DEFINE_MUTEX(sysfs_mutex); DEFINE_MUTEX(sysfs_rename_mutex); -spinlock_t sysfs_assoc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(sysfs_assoc_lock); -static spinlock_t sysfs_ino_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(sysfs_ino_lock); static DEFINE_IDA(sysfs_ino_ida); /** @@ -112,8 +112,7 @@ struct dentry *sysfs_get_dentry(struct sysfs_dirent *sd) /* look it up */ parent = dentry; mutex_lock(&parent->d_inode->i_mutex); - dentry = lookup_one_len_kern(cur->s_name, parent, - strlen(cur->s_name)); + dentry = lookup_one_noperm(cur->s_name, parent); mutex_unlock(&parent->d_inode->i_mutex); dput(parent); diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index c4ef945d39c8..d9262f74f94e 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c @@ -37,6 +37,11 @@ static const struct inode_operations sysfs_inode_operations ={ .setattr = sysfs_setattr, }; +int __init sysfs_inode_init(void) +{ + return bdi_init(&sysfs_backing_dev_info); +} + int sysfs_setattr(struct dentry * dentry, struct iattr * iattr) { struct inode * inode = dentry->d_inode; diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c index c76c540be3c8..74168266cd59 100644 --- a/fs/sysfs/mount.c +++ b/fs/sysfs/mount.c @@ -92,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); diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h index f0326f281d1c..f8417988f6b0 100644 --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h @@ -146,6 +146,7 @@ static inline void sysfs_put(struct sysfs_dirent *sd) struct inode *sysfs_get_inode(struct sysfs_dirent *sd); int sysfs_setattr(struct dentry *dentry, struct iattr *iattr); int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const char *name); +int sysfs_inode_init(void); /* * file.c |