diff options
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r-- | fs/sysfs/inode.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 220b758523ae..6a06a1d1ea7b 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -81,24 +81,23 @@ int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr * iattr) | |||
81 | if (!sd_attrs) | 81 | if (!sd_attrs) |
82 | return -ENOMEM; | 82 | return -ENOMEM; |
83 | sd->s_iattr = sd_attrs; | 83 | sd->s_iattr = sd_attrs; |
84 | } else { | 84 | } |
85 | /* attributes were changed at least once in past */ | 85 | /* attributes were changed at least once in past */ |
86 | iattrs = &sd_attrs->ia_iattr; | 86 | iattrs = &sd_attrs->ia_iattr; |
87 | 87 | ||
88 | if (ia_valid & ATTR_UID) | 88 | if (ia_valid & ATTR_UID) |
89 | iattrs->ia_uid = iattr->ia_uid; | 89 | iattrs->ia_uid = iattr->ia_uid; |
90 | if (ia_valid & ATTR_GID) | 90 | if (ia_valid & ATTR_GID) |
91 | iattrs->ia_gid = iattr->ia_gid; | 91 | iattrs->ia_gid = iattr->ia_gid; |
92 | if (ia_valid & ATTR_ATIME) | 92 | if (ia_valid & ATTR_ATIME) |
93 | iattrs->ia_atime = iattr->ia_atime; | 93 | iattrs->ia_atime = iattr->ia_atime; |
94 | if (ia_valid & ATTR_MTIME) | 94 | if (ia_valid & ATTR_MTIME) |
95 | iattrs->ia_mtime = iattr->ia_mtime; | 95 | iattrs->ia_mtime = iattr->ia_mtime; |
96 | if (ia_valid & ATTR_CTIME) | 96 | if (ia_valid & ATTR_CTIME) |
97 | iattrs->ia_ctime = iattr->ia_ctime; | 97 | iattrs->ia_ctime = iattr->ia_ctime; |
98 | if (ia_valid & ATTR_MODE) { | 98 | if (ia_valid & ATTR_MODE) { |
99 | umode_t mode = iattr->ia_mode; | 99 | umode_t mode = iattr->ia_mode; |
100 | iattrs->ia_mode = sd->s_mode = mode; | 100 | iattrs->ia_mode = sd->s_mode = mode; |
101 | } | ||
102 | } | 101 | } |
103 | return 0; | 102 | return 0; |
104 | } | 103 | } |