Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Linus Torvalds <torvalds@linux-foundation.org>

+2 -2
+2 -2
security/selinux/avc.c
··· 513 513 * be performed under a lock, to allow the lock to be released 514 514 * before calling the auditing code. 515 515 */ 516 - int avc_audit(u32 ssid, u32 tsid, 516 + inline int avc_audit(u32 ssid, u32 tsid, 517 517 u16 tclass, u32 requested, 518 518 struct av_decision *avd, int result, struct common_audit_data *a, 519 519 unsigned flags) ··· 796 796 * auditing, e.g. in cases where a lock must be held for the check but 797 797 * should be released for the auditing. 798 798 */ 799 - int avc_has_perm_noaudit(u32 ssid, u32 tsid, 799 + inline int avc_has_perm_noaudit(u32 ssid, u32 tsid, 800 800 u16 tclass, u32 requested, 801 801 unsigned flags, 802 802 struct av_decision *avd)