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.

kasan, sched/headers: Uninline kasan_enable/disable_current()

<linux/kasan.h> is a low level header that is included early
in affected kernel headers. But it includes <linux/sched.h>
which complicates the cleanup of sched.h dependencies.

But kasan.h has almost no need for sched.h: its only use of
scheduler functionality is in two inline functions which are
not used very frequently - so uninline kasan_enable_current()
and kasan_disable_current().

Also add a <linux/sched.h> dependency to a .c file that depended
on kasan.h including it.

This paves the way to remove the <linux/sched.h> include from kasan.h.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>

+13 -8
+2 -8
include/linux/kasan.h
··· 30 30 } 31 31 32 32 /* Enable reporting bugs after kasan_disable_current() */ 33 - static inline void kasan_enable_current(void) 34 - { 35 - current->kasan_depth++; 36 - } 33 + extern void kasan_enable_current(void); 37 34 38 35 /* Disable reporting bugs for current task */ 39 - static inline void kasan_disable_current(void) 40 - { 41 - current->kasan_depth--; 42 - } 36 + extern void kasan_disable_current(void); 43 37 44 38 void kasan_unpoison_shadow(const void *address, size_t size); 45 39
+1
lib/sbitmap.c
··· 15 15 * along with this program. If not, see <https://www.gnu.org/licenses/>. 16 16 */ 17 17 18 + #include <linux/sched.h> 18 19 #include <linux/random.h> 19 20 #include <linux/sbitmap.h> 20 21 #include <linux/seq_file.h>
+10
mm/kasan/kasan.c
··· 39 39 #include "kasan.h" 40 40 #include "../slab.h" 41 41 42 + void kasan_enable_current(void) 43 + { 44 + current->kasan_depth++; 45 + } 46 + 47 + void kasan_disable_current(void) 48 + { 49 + current->kasan_depth--; 50 + } 51 + 42 52 /* 43 53 * Poisons the shadow memory for 'size' bytes starting from 'addr'. 44 54 * Memory addresses should be aligned to KASAN_SHADOW_SCALE_SIZE.