diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-11-26 07:10:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:55:03 -0500 |
commit | 8d8ad9d7c4bfe79bc91b7fc419ecfb9dcdfe6a51 (patch) | |
tree | 4b655c4b898e634f39fd170eeb8d06f45b240660 /net/unix | |
parent | ce865a61c810c971b47f57c729ec6e9b2d522d94 (diff) |
[NET]: Name magic constants in sock_wake_async()
The sock_wake_async() performs a bit different actions
depending on "how" argument. Unfortunately this argument
ony has numerical magic values.
I propose to give names to their constants to help people
reading this function callers understand what's going on
without looking into this function all the time.
I suppose this is 2.6.25 material, but if it's not (or the
naming seems poor/bad/awful), I can rework it against the
current net-2.6 tree.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/unix')
-rw-r--r-- | net/unix/af_unix.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 0f1ecbf86d0f..393197afb190 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -317,7 +317,7 @@ static void unix_write_space(struct sock *sk) | |||
317 | if (unix_writable(sk)) { | 317 | if (unix_writable(sk)) { |
318 | if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) | 318 | if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) |
319 | wake_up_interruptible_sync(sk->sk_sleep); | 319 | wake_up_interruptible_sync(sk->sk_sleep); |
320 | sk_wake_async(sk, 2, POLL_OUT); | 320 | sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); |
321 | } | 321 | } |
322 | read_unlock(&sk->sk_callback_lock); | 322 | read_unlock(&sk->sk_callback_lock); |
323 | } | 323 | } |
@@ -403,7 +403,7 @@ static int unix_release_sock (struct sock *sk, int embrion) | |||
403 | unix_state_unlock(skpair); | 403 | unix_state_unlock(skpair); |
404 | skpair->sk_state_change(skpair); | 404 | skpair->sk_state_change(skpair); |
405 | read_lock(&skpair->sk_callback_lock); | 405 | read_lock(&skpair->sk_callback_lock); |
406 | sk_wake_async(skpair,1,POLL_HUP); | 406 | sk_wake_async(skpair, SOCK_WAKE_WAITD, POLL_HUP); |
407 | read_unlock(&skpair->sk_callback_lock); | 407 | read_unlock(&skpair->sk_callback_lock); |
408 | } | 408 | } |
409 | sock_put(skpair); /* It may now die */ | 409 | sock_put(skpair); /* It may now die */ |
@@ -1900,9 +1900,9 @@ static int unix_shutdown(struct socket *sock, int mode) | |||
1900 | other->sk_state_change(other); | 1900 | other->sk_state_change(other); |
1901 | read_lock(&other->sk_callback_lock); | 1901 | read_lock(&other->sk_callback_lock); |
1902 | if (peer_mode == SHUTDOWN_MASK) | 1902 | if (peer_mode == SHUTDOWN_MASK) |
1903 | sk_wake_async(other,1,POLL_HUP); | 1903 | sk_wake_async(other, SOCK_WAKE_WAITD, POLL_HUP); |
1904 | else if (peer_mode & RCV_SHUTDOWN) | 1904 | else if (peer_mode & RCV_SHUTDOWN) |
1905 | sk_wake_async(other,1,POLL_IN); | 1905 | sk_wake_async(other, SOCK_WAKE_WAITD, POLL_IN); |
1906 | read_unlock(&other->sk_callback_lock); | 1906 | read_unlock(&other->sk_callback_lock); |
1907 | } | 1907 | } |
1908 | if (other) | 1908 | if (other) |