diff options
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r-- | fs/sysfs/inode.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 3e2837a633ed..963f910c8034 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -10,7 +10,7 @@ | |||
10 | * Please see Documentation/filesystems/sysfs.txt for more information. | 10 | * Please see Documentation/filesystems/sysfs.txt for more information. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #undef DEBUG | 13 | #undef DEBUG |
14 | 14 | ||
15 | #include <linux/pagemap.h> | 15 | #include <linux/pagemap.h> |
16 | #include <linux/namei.h> | 16 | #include <linux/namei.h> |
@@ -36,7 +36,7 @@ static struct backing_dev_info sysfs_backing_dev_info = { | |||
36 | .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK, | 36 | .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK, |
37 | }; | 37 | }; |
38 | 38 | ||
39 | static const struct inode_operations sysfs_inode_operations ={ | 39 | static const struct inode_operations sysfs_inode_operations = { |
40 | .permission = sysfs_permission, | 40 | .permission = sysfs_permission, |
41 | .setattr = sysfs_setattr, | 41 | .setattr = sysfs_setattr, |
42 | .getattr = sysfs_getattr, | 42 | .getattr = sysfs_getattr, |
@@ -67,7 +67,7 @@ static struct sysfs_inode_attrs *sysfs_init_inode_attrs(struct sysfs_dirent *sd) | |||
67 | return attrs; | 67 | return attrs; |
68 | } | 68 | } |
69 | 69 | ||
70 | int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr * iattr) | 70 | int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr *iattr) |
71 | { | 71 | { |
72 | struct sysfs_inode_attrs *sd_attrs; | 72 | struct sysfs_inode_attrs *sd_attrs; |
73 | struct iattr *iattrs; | 73 | struct iattr *iattrs; |
@@ -128,7 +128,8 @@ out: | |||
128 | return error; | 128 | return error; |
129 | } | 129 | } |
130 | 130 | ||
131 | static int sysfs_sd_setsecdata(struct sysfs_dirent *sd, void **secdata, u32 *secdata_len) | 131 | static int sysfs_sd_setsecdata(struct sysfs_dirent *sd, void **secdata, |
132 | u32 *secdata_len) | ||
132 | { | 133 | { |
133 | struct sysfs_inode_attrs *iattrs; | 134 | struct sysfs_inode_attrs *iattrs; |
134 | void *old_secdata; | 135 | void *old_secdata; |
@@ -186,13 +187,13 @@ out: | |||
186 | return error; | 187 | return error; |
187 | } | 188 | } |
188 | 189 | ||
189 | static inline void set_default_inode_attr(struct inode * inode, umode_t mode) | 190 | static inline void set_default_inode_attr(struct inode *inode, umode_t mode) |
190 | { | 191 | { |
191 | inode->i_mode = mode; | 192 | inode->i_mode = mode; |
192 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 193 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
193 | } | 194 | } |
194 | 195 | ||
195 | static inline void set_inode_attr(struct inode * inode, struct iattr * iattr) | 196 | static inline void set_inode_attr(struct inode *inode, struct iattr *iattr) |
196 | { | 197 | { |
197 | inode->i_uid = iattr->ia_uid; | 198 | inode->i_uid = iattr->ia_uid; |
198 | inode->i_gid = iattr->ia_gid; | 199 | inode->i_gid = iattr->ia_gid; |
@@ -220,7 +221,8 @@ static void sysfs_refresh_inode(struct sysfs_dirent *sd, struct inode *inode) | |||
220 | set_nlink(inode, sd->s_dir.subdirs + 2); | 221 | set_nlink(inode, sd->s_dir.subdirs + 2); |
221 | } | 222 | } |
222 | 223 | ||
223 | int sysfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | 224 | int sysfs_getattr(struct vfsmount *mnt, struct dentry *dentry, |
225 | struct kstat *stat) | ||
224 | { | 226 | { |
225 | struct sysfs_dirent *sd = dentry->d_fsdata; | 227 | struct sysfs_dirent *sd = dentry->d_fsdata; |
226 | struct inode *inode = dentry->d_inode; | 228 | struct inode *inode = dentry->d_inode; |
@@ -285,7 +287,7 @@ static void sysfs_init_inode(struct sysfs_dirent *sd, struct inode *inode) | |||
285 | * RETURNS: | 287 | * RETURNS: |
286 | * Pointer to allocated inode on success, NULL on failure. | 288 | * Pointer to allocated inode on success, NULL on failure. |
287 | */ | 289 | */ |
288 | struct inode * sysfs_get_inode(struct super_block *sb, struct sysfs_dirent *sd) | 290 | struct inode *sysfs_get_inode(struct super_block *sb, struct sysfs_dirent *sd) |
289 | { | 291 | { |
290 | struct inode *inode; | 292 | struct inode *inode; |
291 | 293 | ||
@@ -312,7 +314,8 @@ void sysfs_evict_inode(struct inode *inode) | |||
312 | sysfs_put(sd); | 314 | sysfs_put(sd); |
313 | } | 315 | } |
314 | 316 | ||
315 | int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const void *ns, const char *name) | 317 | int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const void *ns, |
318 | const char *name) | ||
316 | { | 319 | { |
317 | struct sysfs_addrm_cxt acxt; | 320 | struct sysfs_addrm_cxt acxt; |
318 | struct sysfs_dirent *sd; | 321 | struct sysfs_dirent *sd; |