diff options
author | Rui Xiang <rui.xiang@huawei.com> | 2014-01-23 18:55:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-23 19:37:01 -0500 |
commit | cdf7e8dded6212cb29f758017a613e4eefc4ce9e (patch) | |
tree | 3a8de28dee0faaedc13379e9e1d889d9a36efe8c /fs | |
parent | 9f6e963f06c19a57a876cb77a9c87f6a56295b13 (diff) |
proc: set attributes of pde using accessor functions
Use existing accessors proc_set_user() and proc_set_size() to set
attributes. Just a cleanup.
Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/proc/generic.c | 3 | ||||
-rw-r--r-- | fs/proc/proc_devtree.c | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index cca93b6fb9a9..b7f268eb5f45 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
@@ -49,8 +49,7 @@ static int proc_notify_change(struct dentry *dentry, struct iattr *iattr) | |||
49 | setattr_copy(inode, iattr); | 49 | setattr_copy(inode, iattr); |
50 | mark_inode_dirty(inode); | 50 | mark_inode_dirty(inode); |
51 | 51 | ||
52 | de->uid = inode->i_uid; | 52 | proc_set_user(de, inode->i_uid, inode->i_gid); |
53 | de->gid = inode->i_gid; | ||
54 | de->mode = inode->i_mode; | 53 | de->mode = inode->i_mode; |
55 | return 0; | 54 | return 0; |
56 | } | 55 | } |
diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c index 70779b2fc209..c824187251f6 100644 --- a/fs/proc/proc_devtree.c +++ b/fs/proc/proc_devtree.c | |||
@@ -74,9 +74,9 @@ __proc_device_tree_add_prop(struct proc_dir_entry *de, struct property *pp, | |||
74 | return NULL; | 74 | return NULL; |
75 | 75 | ||
76 | if (!strncmp(name, "security-", 9)) | 76 | if (!strncmp(name, "security-", 9)) |
77 | ent->size = 0; /* don't leak number of password chars */ | 77 | proc_set_size(ent, 0); /* don't leak number of password chars */ |
78 | else | 78 | else |
79 | ent->size = pp->length; | 79 | proc_set_size(ent, pp->length); |
80 | 80 | ||
81 | return ent; | 81 | return ent; |
82 | } | 82 | } |