aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2006-12-06 23:35:24 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:30 -0500
commited07536ed6731775219c1df7fa26a7588753e693 (patch)
treec539d80fe50f28d4e294850bb33be810f46fd515 /include/net
parentb9d85b08c689dbf54b9943a02f73cb54c2b0fccf (diff)
[PATCH] lockdep: annotate nfs/nfsd in-kernel sockets
Stick NFS sockets in their own class to avoid some lockdep warnings. NFS sockets are never exposed to user-space, and will hence not trigger certain code paths that would otherwise pose deadlock scenarios. [akpm@osdl.org: cleanups] Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Steven Dickson <SteveD@redhat.com> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Acked-by: Neil Brown <neilb@suse.de> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@osdl.org> [ Fixed patch corruption by quilt, pointed out by Peter Zijlstra ] Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/sock.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 730899ce5162..03684e702d13 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -746,6 +746,25 @@ static inline int sk_stream_wmem_schedule(struct sock *sk, int size)
746 */ 746 */
747#define sock_owned_by_user(sk) ((sk)->sk_lock.owner) 747#define sock_owned_by_user(sk) ((sk)->sk_lock.owner)
748 748
749/*
750 * Macro so as to not evaluate some arguments when
751 * lockdep is not enabled.
752 *
753 * Mark both the sk_lock and the sk_lock.slock as a
754 * per-address-family lock class.
755 */
756#define sock_lock_init_class_and_name(sk, sname, skey, name, key) \
757do { \
758 sk->sk_lock.owner = NULL; \
759 init_waitqueue_head(&sk->sk_lock.wq); \
760 spin_lock_init(&(sk)->sk_lock.slock); \
761 debug_check_no_locks_freed((void *)&(sk)->sk_lock, \
762 sizeof((sk)->sk_lock)); \
763 lockdep_set_class_and_name(&(sk)->sk_lock.slock, \
764 (skey), (sname)); \
765 lockdep_init_map(&(sk)->sk_lock.dep_map, (name), (key), 0); \
766} while (0)
767
749extern void FASTCALL(lock_sock_nested(struct sock *sk, int subclass)); 768extern void FASTCALL(lock_sock_nested(struct sock *sk, int subclass));
750 769
751static inline void lock_sock(struct sock *sk) 770static inline void lock_sock(struct sock *sk)