diff options
| author | Len Brown <len.brown@intel.com> | 2005-07-30 01:55:32 -0400 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2005-07-30 01:55:32 -0400 |
| commit | adbedd34244e2b054557002817f979a9b004a405 (patch) | |
| tree | 78e4a524e84f8b3e23ae8b49ac689048584e4668 /fs/sysfs/file.c | |
| parent | d6ac1a7910d22626bc77e73db091e00b810715f4 (diff) | |
| parent | b0825488a642cadcf39709961dde61440cb0731c (diff) | |
merge 2.6.13-rc4 with ACPI's to-linus tree
Diffstat (limited to 'fs/sysfs/file.c')
| -rw-r--r-- | fs/sysfs/file.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 335288b9be0f..4013d7905e84 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -437,8 +437,8 @@ int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode) { struct dentry *dir = kobj->dentry; struct dentry *victim; - struct sysfs_dirent *sd; - umode_t umode = (mode & S_IALLUGO) | S_IFREG; + struct inode * inode; + struct iattr newattrs; int res = -ENOENT; down(&dir->d_inode->i_sem); @@ -446,13 +446,15 @@ int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode) if (!IS_ERR(victim)) { if (victim->d_inode && (victim->d_parent->d_inode == dir->d_inode)) { - sd = victim->d_fsdata; - attr->mode = mode; - sd->s_mode = umode; - victim->d_inode->i_mode = umode; - dput(victim); - res = 0; + inode = victim->d_inode; + down(&inode->i_sem); + newattrs.ia_mode = (mode & S_IALLUGO) | + (inode->i_mode & ~S_IALLUGO); + newattrs.ia_valid = ATTR_MODE | ATTR_CTIME; + res = notify_change(victim, &newattrs); + up(&inode->i_sem); } + dput(victim); } up(&dir->d_inode->i_sem); |
