History

audit: inline audit_free to simplify the look of generic code

make the conditional a static inline instead of doing it in generic code.

Eric Paris committed 14 years ago

Commit a4ff8db1 parent 38cdce53 files · +8 −4Browse files

Unified · Split

3 files
  1. include/linux/audit.h +6 −1
  2. kernel/auditsc.c +1 −1
  3. kernel/exit.c +1 −2
include/linux/audit.h+6−1
@@ -417,7 +417,7 @@ extern int audit_classify_arch(int arch); · 416 unmodified lines
417 /* Public API */417 /* Public API */
418extern void audit_finish_fork(struct task_struct *child);418extern void audit_finish_fork(struct task_struct *child);
419extern int audit_alloc(struct task_struct *task);419extern int audit_alloc(struct task_struct *task);
420extern void audit_free(struct task_struct *task);420extern void __audit_free(struct task_struct *task);
421extern void __audit_syscall_entry(int arch,421extern void __audit_syscall_entry(int arch,
422 int major, unsigned long a0, unsigned long a1,422 int major, unsigned long a0, unsigned long a1,
423 unsigned long a2, unsigned long a3);423 unsigned long a2, unsigned long a3);
@@ -435,6 +435,11 @@ static inline int audit_dummy_context(void) · 11 unmodified lines
435 void *p = current->audit_context;435 void *p = current->audit_context;
436 return !p || *(int *)p;436 return !p || *(int *)p;
437}437}
438static inline void audit_free(struct task_struct *task)
439{
440 if (unlikely(task->audit_context))
441 __audit_free(task);
442}
438static inline void audit_syscall_entry(int arch, int major, unsigned long a0,443static inline void audit_syscall_entry(int arch, int major, unsigned long a0,
439 unsigned long a1, unsigned long a2,444 unsigned long a1, unsigned long a2,
440 unsigned long a3)445 unsigned long a3)
kernel/auditsc.c+1−1
@@ -1594,7 +1594,7 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts · 1593 unmodified lines
1594 *1594 *
1595 * Called from copy_process and do_exit1595 * Called from copy_process and do_exit
1596 */1596 */
1597void audit_free(struct task_struct *tsk)1597void __audit_free(struct task_struct *tsk)
1598{1598{
1599 struct audit_context *context;1599 struct audit_context *context;
1600 1600
kernel/exit.c+1−2
@@ -964,8 +964,7 @@ NORET_TYPE void do_exit(long code) · 963 unmodified lines
964 acct_collect(code, group_dead);964 acct_collect(code, group_dead);
965 if (group_dead)965 if (group_dead)
966 tty_audit_exit();966 tty_audit_exit();
967 if (unlikely(tsk->audit_context))967 audit_free(tsk);
968 audit_free(tsk);
969 968
970 tsk->exit_code = code;969 tsk->exit_code = code;
971 taskstats_exit(tsk, group_dead);970 taskstats_exit(tsk, group_dead);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t