Re: [build failure] Re: BKL: remove extraneous #include <smp_lock.h>

From: Linus Torvalds
Date: Thu Nov 18 2010 - 11:03:57 EST


On Thu, Nov 18, 2010 at 7:57 AM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> How painful would it be to move lock_depth into thread_struct? I guess
> we don't have anything that cares about structure offsets in assembly
> for that thing.  I should just try.

Gaah, the only generic field there is the restart_block, so we'd have
to hide it there, or then add it to each architecture. So scratch
that.

I guess this is the simplest approach.

Linus
include/linux/hardirq.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 714da7e..32f9fd6 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -94,6 +94,7 @@
#define in_nmi() (preempt_count() & NMI_MASK)

#if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL)
+# include <linux/sched.h>
# define PREEMPT_INATOMIC_BASE (current->lock_depth >= 0)
#else
# define PREEMPT_INATOMIC_BASE 0