Skip to content

Commit

Permalink
proc: set attributes of pde using accessor functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rui Xiang authored and torvalds committed Jan 24, 2014
1 parent 9f6e963 commit cdf7e8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions fs/proc/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ static int proc_notify_change(struct dentry *dentry, struct iattr *iattr)
setattr_copy(inode, iattr);
mark_inode_dirty(inode);

de->uid = inode->i_uid;
de->gid = inode->i_gid;
proc_set_user(de, inode->i_uid, inode->i_gid);
de->mode = inode->i_mode;
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions fs/proc/proc_devtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ __proc_device_tree_add_prop(struct proc_dir_entry *de, struct property *pp,
return NULL;

if (!strncmp(name, "security-", 9))
ent->size = 0; /* don't leak number of password chars */
proc_set_size(ent, 0); /* don't leak number of password chars */
else
ent->size = pp->length;
proc_set_size(ent, pp->length);

return ent;
}
Expand Down

0 comments on commit cdf7e8d

Please sign in to comment.