aboutsummaryrefslogtreecommitdiffstats
path: root/fs/kernfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/kernfs/inode.c')
-rw-r--r--fs/kernfs/inode.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/kernfs/inode.c b/fs/kernfs/inode.c
index f6c0aae3dd5c..a0e0038fd570 100644
--- a/fs/kernfs/inode.c
+++ b/fs/kernfs/inode.c
@@ -46,14 +46,14 @@ void __init sysfs_inode_init(void)
46 panic("failed to init sysfs_backing_dev_info"); 46 panic("failed to init sysfs_backing_dev_info");
47} 47}
48 48
49static struct sysfs_inode_attrs *sysfs_inode_attrs(struct kernfs_node *kn) 49static struct kernfs_iattrs *kernfs_iattrs(struct kernfs_node *kn)
50{ 50{
51 struct iattr *iattrs; 51 struct iattr *iattrs;
52 52
53 if (kn->iattr) 53 if (kn->iattr)
54 return kn->iattr; 54 return kn->iattr;
55 55
56 kn->iattr = kzalloc(sizeof(struct sysfs_inode_attrs), GFP_KERNEL); 56 kn->iattr = kzalloc(sizeof(struct kernfs_iattrs), GFP_KERNEL);
57 if (!kn->iattr) 57 if (!kn->iattr)
58 return NULL; 58 return NULL;
59 iattrs = &kn->iattr->ia_iattr; 59 iattrs = &kn->iattr->ia_iattr;
@@ -71,11 +71,11 @@ static struct sysfs_inode_attrs *sysfs_inode_attrs(struct kernfs_node *kn)
71 71
72static int __kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr) 72static int __kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr)
73{ 73{
74 struct sysfs_inode_attrs *attrs; 74 struct kernfs_iattrs *attrs;
75 struct iattr *iattrs; 75 struct iattr *iattrs;
76 unsigned int ia_valid = iattr->ia_valid; 76 unsigned int ia_valid = iattr->ia_valid;
77 77
78 attrs = sysfs_inode_attrs(kn); 78 attrs = kernfs_iattrs(kn);
79 if (!attrs) 79 if (!attrs)
80 return -ENOMEM; 80 return -ENOMEM;
81 81
@@ -144,11 +144,11 @@ out:
144static int sysfs_sd_setsecdata(struct kernfs_node *kn, void **secdata, 144static int sysfs_sd_setsecdata(struct kernfs_node *kn, void **secdata,
145 u32 *secdata_len) 145 u32 *secdata_len)
146{ 146{
147 struct sysfs_inode_attrs *attrs; 147 struct kernfs_iattrs *attrs;
148 void *old_secdata; 148 void *old_secdata;
149 size_t old_secdata_len; 149 size_t old_secdata_len;
150 150
151 attrs = sysfs_inode_attrs(kn); 151 attrs = kernfs_iattrs(kn);
152 if (!attrs) 152 if (!attrs)
153 return -ENOMEM; 153 return -ENOMEM;
154 154
@@ -167,12 +167,12 @@ int sysfs_setxattr(struct dentry *dentry, const char *name, const void *value,
167 size_t size, int flags) 167 size_t size, int flags)
168{ 168{
169 struct kernfs_node *kn = dentry->d_fsdata; 169 struct kernfs_node *kn = dentry->d_fsdata;
170 struct sysfs_inode_attrs *attrs; 170 struct kernfs_iattrs *attrs;
171 void *secdata; 171 void *secdata;
172 int error; 172 int error;
173 u32 secdata_len = 0; 173 u32 secdata_len = 0;
174 174
175 attrs = sysfs_inode_attrs(kn); 175 attrs = kernfs_iattrs(kn);
176 if (!attrs) 176 if (!attrs)
177 return -ENOMEM; 177 return -ENOMEM;
178 178
@@ -205,9 +205,9 @@ int sysfs_setxattr(struct dentry *dentry, const char *name, const void *value,
205int sysfs_removexattr(struct dentry *dentry, const char *name) 205int sysfs_removexattr(struct dentry *dentry, const char *name)
206{ 206{
207 struct kernfs_node *kn = dentry->d_fsdata; 207 struct kernfs_node *kn = dentry->d_fsdata;
208 struct sysfs_inode_attrs *attrs; 208 struct kernfs_iattrs *attrs;
209 209
210 attrs = sysfs_inode_attrs(kn); 210 attrs = kernfs_iattrs(kn);
211 if (!attrs) 211 if (!attrs)
212 return -ENOMEM; 212 return -ENOMEM;
213 213
@@ -218,9 +218,9 @@ ssize_t sysfs_getxattr(struct dentry *dentry, const char *name, void *buf,
218 size_t size) 218 size_t size)
219{ 219{
220 struct kernfs_node *kn = dentry->d_fsdata; 220 struct kernfs_node *kn = dentry->d_fsdata;
221 struct sysfs_inode_attrs *attrs; 221 struct kernfs_iattrs *attrs;
222 222
223 attrs = sysfs_inode_attrs(kn); 223 attrs = kernfs_iattrs(kn);
224 if (!attrs) 224 if (!attrs)
225 return -ENOMEM; 225 return -ENOMEM;
226 226
@@ -230,9 +230,9 @@ ssize_t sysfs_getxattr(struct dentry *dentry, const char *name, void *buf,
230ssize_t sysfs_listxattr(struct dentry *dentry, char *buf, size_t size) 230ssize_t sysfs_listxattr(struct dentry *dentry, char *buf, size_t size)
231{ 231{
232 struct kernfs_node *kn = dentry->d_fsdata; 232 struct kernfs_node *kn = dentry->d_fsdata;
233 struct sysfs_inode_attrs *attrs; 233 struct kernfs_iattrs *attrs;
234 234
235 attrs = sysfs_inode_attrs(kn); 235 attrs = kernfs_iattrs(kn);
236 if (!attrs) 236 if (!attrs)
237 return -ENOMEM; 237 return -ENOMEM;
238 238
@@ -256,7 +256,7 @@ static inline void set_inode_attr(struct inode *inode, struct iattr *iattr)
256 256
257static void sysfs_refresh_inode(struct kernfs_node *kn, struct inode *inode) 257static void sysfs_refresh_inode(struct kernfs_node *kn, struct inode *inode)
258{ 258{
259 struct sysfs_inode_attrs *attrs = kn->iattr; 259 struct kernfs_iattrs *attrs = kn->iattr;
260 260
261 inode->i_mode = kn->mode; 261 inode->i_mode = kn->mode;
262 if (attrs) { 262 if (attrs) {