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/socket.c | |
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/socket.c')
-rw-r--r-- | net/socket.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/socket.c b/net/socket.c index aeeab388cc38..9ebca5c695d6 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -1070,20 +1070,19 @@ int sock_wake_async(struct socket *sock, int how, int band) | |||
1070 | if (!sock || !sock->fasync_list) | 1070 | if (!sock || !sock->fasync_list) |
1071 | return -1; | 1071 | return -1; |
1072 | switch (how) { | 1072 | switch (how) { |
1073 | case 1: | 1073 | case SOCK_WAKE_WAITD: |
1074 | |||
1075 | if (test_bit(SOCK_ASYNC_WAITDATA, &sock->flags)) | 1074 | if (test_bit(SOCK_ASYNC_WAITDATA, &sock->flags)) |
1076 | break; | 1075 | break; |
1077 | goto call_kill; | 1076 | goto call_kill; |
1078 | case 2: | 1077 | case SOCK_WAKE_SPACE: |
1079 | if (!test_and_clear_bit(SOCK_ASYNC_NOSPACE, &sock->flags)) | 1078 | if (!test_and_clear_bit(SOCK_ASYNC_NOSPACE, &sock->flags)) |
1080 | break; | 1079 | break; |
1081 | /* fall through */ | 1080 | /* fall through */ |
1082 | case 0: | 1081 | case SOCK_WAKE_IO: |
1083 | call_kill: | 1082 | call_kill: |
1084 | __kill_fasync(sock->fasync_list, SIGIO, band); | 1083 | __kill_fasync(sock->fasync_list, SIGIO, band); |
1085 | break; | 1084 | break; |
1086 | case 3: | 1085 | case SOCK_WAKE_URG: |
1087 | __kill_fasync(sock->fasync_list, SIGURG, band); | 1086 | __kill_fasync(sock->fasync_list, SIGURG, band); |
1088 | } | 1087 | } |
1089 | return 0; | 1088 | return 0; |