Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66375
b: refs/heads/master
c: d2e9117
h: refs/heads/master
i:
  66373: 1a26910
  66371: ee6581b
  66367: cbae7b9
v: v3
  • Loading branch information
John Heffner authored and David S. Miller committed Oct 10, 2007
1 parent f34b841 commit 0217f8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 02b3d34631831a19ee691516e233756b270eac6d
refs/heads/master: d2e9117c7aa9544d910634e17e3519fd67155229
7 changes: 3 additions & 4 deletions trunk/include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@
* between user contexts and software interrupt processing, whereas the
* mini-semaphore synchronizes multiple users amongst themselves.
*/
struct sock_iocb;
typedef struct {
spinlock_t slock;
struct sock_iocb *owner;
int owned;
wait_queue_head_t wq;
/*
* We express the mutex-alike socket_lock semantics
Expand Down Expand Up @@ -737,7 +736,7 @@ static inline int sk_stream_wmem_schedule(struct sock *sk, int size)
* Since ~2.3.5 it is also exclusive sleep lock serializing
* accesses from user process context.
*/
#define sock_owned_by_user(sk) ((sk)->sk_lock.owner)
#define sock_owned_by_user(sk) ((sk)->sk_lock.owned)

/*
* Macro so as to not evaluate some arguments when
Expand All @@ -748,7 +747,7 @@ static inline int sk_stream_wmem_schedule(struct sock *sk, int size)
*/
#define sock_lock_init_class_and_name(sk, sname, skey, name, key) \
do { \
sk->sk_lock.owner = NULL; \
sk->sk_lock.owned = 0; \
init_waitqueue_head(&sk->sk_lock.wq); \
spin_lock_init(&(sk)->sk_lock.slock); \
debug_check_no_locks_freed((void *)&(sk)->sk_lock, \
Expand Down
6 changes: 3 additions & 3 deletions trunk/net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1585,9 +1585,9 @@ void fastcall lock_sock_nested(struct sock *sk, int subclass)
{
might_sleep();
spin_lock_bh(&sk->sk_lock.slock);
if (sk->sk_lock.owner)
if (sk->sk_lock.owned)
__lock_sock(sk);
sk->sk_lock.owner = (void *)1;
sk->sk_lock.owned = 1;
spin_unlock(&sk->sk_lock.slock);
/*
* The sk_lock has mutex_lock() semantics here:
Expand All @@ -1608,7 +1608,7 @@ void fastcall release_sock(struct sock *sk)
spin_lock_bh(&sk->sk_lock.slock);
if (sk->sk_backlog.tail)
__release_sock(sk);
sk->sk_lock.owner = NULL;
sk->sk_lock.owned = 0;
if (waitqueue_active(&sk->sk_lock.wq))
wake_up(&sk->sk_lock.wq);
spin_unlock_bh(&sk->sk_lock.slock);
Expand Down

0 comments on commit 0217f8e

Please sign in to comment.