diff options
Diffstat (limited to 'fs/sysfs/file.c')
-rw-r--r-- | fs/sysfs/file.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 849aac115460..e9cfa39f4099 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/module.h> | 5 | #include <linux/module.h> |
6 | #include <linux/dnotify.h> | 6 | #include <linux/dnotify.h> |
7 | #include <linux/kobject.h> | 7 | #include <linux/kobject.h> |
8 | #include <linux/namei.h> | ||
8 | #include <asm/uaccess.h> | 9 | #include <asm/uaccess.h> |
9 | #include <asm/semaphore.h> | 10 | #include <asm/semaphore.h> |
10 | 11 | ||
@@ -400,7 +401,7 @@ int sysfs_update_file(struct kobject * kobj, const struct attribute * attr) | |||
400 | int res = -ENOENT; | 401 | int res = -ENOENT; |
401 | 402 | ||
402 | down(&dir->d_inode->i_sem); | 403 | down(&dir->d_inode->i_sem); |
403 | victim = sysfs_get_dentry(dir, attr->name); | 404 | victim = lookup_one_len(attr->name, dir, strlen(attr->name)); |
404 | if (!IS_ERR(victim)) { | 405 | if (!IS_ERR(victim)) { |
405 | /* make sure dentry is really there */ | 406 | /* make sure dentry is really there */ |
406 | if (victim->d_inode && | 407 | if (victim->d_inode && |
@@ -443,7 +444,7 @@ int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode) | |||
443 | int res = -ENOENT; | 444 | int res = -ENOENT; |
444 | 445 | ||
445 | down(&dir->d_inode->i_sem); | 446 | down(&dir->d_inode->i_sem); |
446 | victim = sysfs_get_dentry(dir, attr->name); | 447 | victim = lookup_one_len(attr->name, dir, strlen(attr->name)); |
447 | if (!IS_ERR(victim)) { | 448 | if (!IS_ERR(victim)) { |
448 | if (victim->d_inode && | 449 | if (victim->d_inode && |
449 | (victim->d_parent->d_inode == dir->d_inode)) { | 450 | (victim->d_parent->d_inode == dir->d_inode)) { |