diff options
author | Eric Paris <eparis@redhat.com> | 2010-10-25 14:42:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-26 14:37:18 -0400 |
commit | bc7d2a3e66b40477270c3cbe3b89b47093276e7a (patch) | |
tree | 8f0198b8ad455fde11b24e32a2e32c008a5ececb /security/security.c | |
parent | a178d2027d3198b0a04517d764326ab71cd73da2 (diff) |
IMA: only allocate iint when needed
IMA always allocates an integrity structure to hold information about
every inode, but only needed this structure to track the number of
readers and writers currently accessing a given inode. Since that
information was moved into struct inode instead of the integrity struct
this patch stops allocating the integrity stucture until it is needed.
Thus greatly reducing memory usage.
Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security/security.c')
-rw-r--r-- | security/security.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/security/security.c b/security/security.c index c53949f17d9e..a3b47feccae9 100644 --- a/security/security.c +++ b/security/security.c | |||
@@ -333,16 +333,8 @@ EXPORT_SYMBOL(security_sb_parse_opts_str); | |||
333 | 333 | ||
334 | int security_inode_alloc(struct inode *inode) | 334 | int security_inode_alloc(struct inode *inode) |
335 | { | 335 | { |
336 | int ret; | ||
337 | |||
338 | inode->i_security = NULL; | 336 | inode->i_security = NULL; |
339 | ret = security_ops->inode_alloc_security(inode); | 337 | return security_ops->inode_alloc_security(inode); |
340 | if (ret) | ||
341 | return ret; | ||
342 | ret = ima_inode_alloc(inode); | ||
343 | if (ret) | ||
344 | security_inode_free(inode); | ||
345 | return ret; | ||
346 | } | 338 | } |
347 | 339 | ||
348 | void security_inode_free(struct inode *inode) | 340 | void security_inode_free(struct inode *inode) |