Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320255
b: refs/heads/master
c: 327800b
h: refs/heads/master
i:
  320253: d451d2f
  320251: 3e8b628
  320247: 5343646
  320239: 6239733
  320223: 0d9240a
  320191: 2651e24
  320127: 386170a
  319999: 0a16c7c
v: v3
  • Loading branch information
Alex Elder authored and Alex Elder committed Jun 1, 2012
1 parent ce78959 commit 37c6886
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 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: 6384bb8b8e88a9c6bf2ae0d9517c2c0199177c34
refs/heads/master: 327800bdc2cb9b71f4b458ca07aa9d522668dde0
28 changes: 14 additions & 14 deletions trunk/net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,56 +153,56 @@ EXPORT_SYMBOL(ceph_msgr_flush);
*/

/* data available on socket, or listen socket received a connect */
static void ceph_data_ready(struct sock *sk, int count_unused)
static void ceph_sock_data_ready(struct sock *sk, int count_unused)
{
struct ceph_connection *con = sk->sk_user_data;

if (sk->sk_state != TCP_CLOSE_WAIT) {
dout("ceph_data_ready on %p state = %lu, queueing work\n",
dout("%s on %p state = %lu, queueing work\n", __func__,
con, con->state);
queue_con(con);
}
}

/* socket has buffer space for writing */
static void ceph_write_space(struct sock *sk)
static void ceph_sock_write_space(struct sock *sk)
{
struct ceph_connection *con = sk->sk_user_data;

/* only queue to workqueue if there is data we want to write,
* and there is sufficient space in the socket buffer to accept
* more data. clear SOCK_NOSPACE so that ceph_write_space()
* more data. clear SOCK_NOSPACE so that ceph_sock_write_space()
* doesn't get called again until try_write() fills the socket
* buffer. See net/ipv4/tcp_input.c:tcp_check_space()
* and net/core/stream.c:sk_stream_write_space().
*/
if (test_bit(WRITE_PENDING, &con->state)) {
if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk)) {
dout("ceph_write_space %p queueing write work\n", con);
dout("%s %p queueing write work\n", __func__, con);
clear_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
queue_con(con);
}
} else {
dout("ceph_write_space %p nothing to write\n", con);
dout("%s %p nothing to write\n", __func__, con);
}
}

/* socket's state has changed */
static void ceph_state_change(struct sock *sk)
static void ceph_sock_state_change(struct sock *sk)
{
struct ceph_connection *con = sk->sk_user_data;

dout("ceph_state_change %p state = %lu sk_state = %u\n",
dout("%s %p state = %lu sk_state = %u\n", __func__,
con, con->state, sk->sk_state);

if (test_bit(CLOSED, &con->state))
return;

switch (sk->sk_state) {
case TCP_CLOSE:
dout("ceph_state_change TCP_CLOSE\n");
dout("%s TCP_CLOSE\n", __func__);
case TCP_CLOSE_WAIT:
dout("ceph_state_change TCP_CLOSE_WAIT\n");
dout("%s TCP_CLOSE_WAIT\n", __func__);
if (test_and_set_bit(SOCK_CLOSED, &con->state) == 0) {
if (test_bit(CONNECTING, &con->state))
con->error_msg = "connection failed";
Expand All @@ -212,7 +212,7 @@ static void ceph_state_change(struct sock *sk)
}
break;
case TCP_ESTABLISHED:
dout("ceph_state_change TCP_ESTABLISHED\n");
dout("%s TCP_ESTABLISHED\n", __func__);
queue_con(con);
break;
default: /* Everything else is uninteresting */
Expand All @@ -228,9 +228,9 @@ static void set_sock_callbacks(struct socket *sock,
{
struct sock *sk = sock->sk;
sk->sk_user_data = con;
sk->sk_data_ready = ceph_data_ready;
sk->sk_write_space = ceph_write_space;
sk->sk_state_change = ceph_state_change;
sk->sk_data_ready = ceph_sock_data_ready;
sk->sk_write_space = ceph_sock_write_space;
sk->sk_state_change = ceph_sock_state_change;
}


Expand Down

0 comments on commit 37c6886

Please sign in to comment.