diff options
author | John Heffner <jheffner@psc.edu> | 2007-09-12 04:44:19 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:49:01 -0400 |
commit | d2e9117c7aa9544d910634e17e3519fd67155229 (patch) | |
tree | 531507ed5d2031fa80775036fec1b57584a236cb /include/net/sock.h | |
parent | 02b3d34631831a19ee691516e233756b270eac6d (diff) |
[NET]: Change type of owner in sock_lock_t to int, rename
The type of owner in sock_lock_t is currently (struct sock_iocb *),
presumably for historical reasons. It is never used as this type, only
tested as NULL or set to (void *)1. For clarity, this changes it to type
int, and renames to owned, to avoid any possible type casting errors.
Signed-off-by: John Heffner <jheffner@psc.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 802c670ba820..5ed9fa42b6e8 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -76,10 +76,9 @@ | |||
76 | * between user contexts and software interrupt processing, whereas the | 76 | * between user contexts and software interrupt processing, whereas the |
77 | * mini-semaphore synchronizes multiple users amongst themselves. | 77 | * mini-semaphore synchronizes multiple users amongst themselves. |
78 | */ | 78 | */ |
79 | struct sock_iocb; | ||
80 | typedef struct { | 79 | typedef struct { |
81 | spinlock_t slock; | 80 | spinlock_t slock; |
82 | struct sock_iocb *owner; | 81 | int owned; |
83 | wait_queue_head_t wq; | 82 | wait_queue_head_t wq; |
84 | /* | 83 | /* |
85 | * We express the mutex-alike socket_lock semantics | 84 | * We express the mutex-alike socket_lock semantics |
@@ -737,7 +736,7 @@ static inline int sk_stream_wmem_schedule(struct sock *sk, int size) | |||
737 | * Since ~2.3.5 it is also exclusive sleep lock serializing | 736 | * Since ~2.3.5 it is also exclusive sleep lock serializing |
738 | * accesses from user process context. | 737 | * accesses from user process context. |
739 | */ | 738 | */ |
740 | #define sock_owned_by_user(sk) ((sk)->sk_lock.owner) | 739 | #define sock_owned_by_user(sk) ((sk)->sk_lock.owned) |
741 | 740 | ||
742 | /* | 741 | /* |
743 | * Macro so as to not evaluate some arguments when | 742 | * Macro so as to not evaluate some arguments when |
@@ -748,7 +747,7 @@ static inline int sk_stream_wmem_schedule(struct sock *sk, int size) | |||
748 | */ | 747 | */ |
749 | #define sock_lock_init_class_and_name(sk, sname, skey, name, key) \ | 748 | #define sock_lock_init_class_and_name(sk, sname, skey, name, key) \ |
750 | do { \ | 749 | do { \ |
751 | sk->sk_lock.owner = NULL; \ | 750 | sk->sk_lock.owned = 0; \ |
752 | init_waitqueue_head(&sk->sk_lock.wq); \ | 751 | init_waitqueue_head(&sk->sk_lock.wq); \ |
753 | spin_lock_init(&(sk)->sk_lock.slock); \ | 752 | spin_lock_init(&(sk)->sk_lock.slock); \ |
754 | debug_check_no_locks_freed((void *)&(sk)->sk_lock, \ | 753 | debug_check_no_locks_freed((void *)&(sk)->sk_lock, \ |