Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06825ba3 authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds
Browse files

[PATCH] lockdep: annotate skb_queue_head_init



Teach special (multi-initialized) locking code to the lock validator.  Has no
effect on non-lockdep kernels.

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3aceafc1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -604,9 +604,12 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_)
	return list_->qlen;
}

extern struct lock_class_key skb_queue_lock_key;

static inline void skb_queue_head_init(struct sk_buff_head *list)
{
	spin_lock_init(&list->lock);
	lockdep_set_class(&list->lock, &skb_queue_lock_key);
	list->prev = list->next = (struct sk_buff *)list;
	list->qlen = 0;
}
+7 −0
Original line number Diff line number Diff line
@@ -70,6 +70,13 @@
static kmem_cache_t *skbuff_head_cache __read_mostly;
static kmem_cache_t *skbuff_fclone_cache __read_mostly;

/*
 * lockdep: lock class key used by skb_queue_head_init():
 */
struct lock_class_key skb_queue_lock_key;

EXPORT_SYMBOL(skb_queue_lock_key);

/*
 *	Keep out-of-line to prevent kernel bloat.
 *	__builtin_return_address is not used because it is not always