diff options
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r-- | fs/sysfs/inode.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 970a33f03299..689f7bcfaf30 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/pagemap.h> | 11 | #include <linux/pagemap.h> |
12 | #include <linux/namei.h> | 12 | #include <linux/namei.h> |
13 | #include <linux/backing-dev.h> | 13 | #include <linux/backing-dev.h> |
14 | #include <linux/capability.h> | ||
14 | #include "sysfs.h" | 15 | #include "sysfs.h" |
15 | 16 | ||
16 | extern struct super_block * sysfs_sb; | 17 | extern struct super_block * sysfs_sb; |
@@ -201,7 +202,7 @@ const unsigned char * sysfs_get_name(struct sysfs_dirent *sd) | |||
201 | 202 | ||
202 | /* | 203 | /* |
203 | * Unhashes the dentry corresponding to given sysfs_dirent | 204 | * Unhashes the dentry corresponding to given sysfs_dirent |
204 | * Called with parent inode's i_sem held. | 205 | * Called with parent inode's i_mutex held. |
205 | */ | 206 | */ |
206 | void sysfs_drop_dentry(struct sysfs_dirent * sd, struct dentry * parent) | 207 | void sysfs_drop_dentry(struct sysfs_dirent * sd, struct dentry * parent) |
207 | { | 208 | { |
@@ -232,7 +233,7 @@ void sysfs_hash_and_remove(struct dentry * dir, const char * name) | |||
232 | /* no inode means this hasn't been made visible yet */ | 233 | /* no inode means this hasn't been made visible yet */ |
233 | return; | 234 | return; |
234 | 235 | ||
235 | down(&dir->d_inode->i_sem); | 236 | mutex_lock(&dir->d_inode->i_mutex); |
236 | list_for_each_entry(sd, &parent_sd->s_children, s_sibling) { | 237 | list_for_each_entry(sd, &parent_sd->s_children, s_sibling) { |
237 | if (!sd->s_element) | 238 | if (!sd->s_element) |
238 | continue; | 239 | continue; |
@@ -243,7 +244,5 @@ void sysfs_hash_and_remove(struct dentry * dir, const char * name) | |||
243 | break; | 244 | break; |
244 | } | 245 | } |
245 | } | 246 | } |
246 | up(&dir->d_inode->i_sem); | 247 | mutex_unlock(&dir->d_inode->i_mutex); |
247 | } | 248 | } |
248 | |||
249 | |||