Commit cdb0f9a1 authored by Linus Torvalds's avatar Linus Torvalds

selinux: inline avc_audit() and avc_has_perm_noaudit() into caller

Now that all the slow-path code is gone from these functions, we can
inline them into the main caller - avc_has_perm_flags().

Now the compiler can see that 'avc' is allocated on the stack for this
case, which helps register pressure a bit.  It also actually shrinks the
total stack frame, because the stack frame that avc_has_perm_flags()
always needed (for that 'avc' allocation) is now sufficient for the
inlined functions too.

Inlining isn't bad - but mindless inlining of cold code (see the
previous commit) is.
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a554bea8
...@@ -513,7 +513,7 @@ static noinline int slow_avc_audit(u32 ssid, u32 tsid, u16 tclass, ...@@ -513,7 +513,7 @@ static noinline int slow_avc_audit(u32 ssid, u32 tsid, u16 tclass,
* be performed under a lock, to allow the lock to be released * be performed under a lock, to allow the lock to be released
* before calling the auditing code. * before calling the auditing code.
*/ */
int avc_audit(u32 ssid, u32 tsid, inline int avc_audit(u32 ssid, u32 tsid,
u16 tclass, u32 requested, u16 tclass, u32 requested,
struct av_decision *avd, int result, struct common_audit_data *a, struct av_decision *avd, int result, struct common_audit_data *a,
unsigned flags) unsigned flags)
...@@ -796,7 +796,7 @@ static noinline int avc_denied(u32 ssid, u32 tsid, ...@@ -796,7 +796,7 @@ static noinline int avc_denied(u32 ssid, u32 tsid,
* auditing, e.g. in cases where a lock must be held for the check but * auditing, e.g. in cases where a lock must be held for the check but
* should be released for the auditing. * should be released for the auditing.
*/ */
int avc_has_perm_noaudit(u32 ssid, u32 tsid, inline int avc_has_perm_noaudit(u32 ssid, u32 tsid,
u16 tclass, u32 requested, u16 tclass, u32 requested,
unsigned flags, unsigned flags,
struct av_decision *avd) struct av_decision *avd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment