diff options
Diffstat (limited to 'fs/ceph/messenger.c')
-rw-r--r-- | fs/ceph/messenger.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/ceph/messenger.c b/fs/ceph/messenger.c index 781656a49bf8..8f1715ffbe4b 100644 --- a/fs/ceph/messenger.c +++ b/fs/ceph/messenger.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/inet.h> | 6 | #include <linux/inet.h> |
7 | #include <linux/kthread.h> | 7 | #include <linux/kthread.h> |
8 | #include <linux/net.h> | 8 | #include <linux/net.h> |
9 | #include <linux/slab.h> | ||
9 | #include <linux/socket.h> | 10 | #include <linux/socket.h> |
10 | #include <linux/string.h> | 11 | #include <linux/string.h> |
11 | #include <net/tcp.h> | 12 | #include <net/tcp.h> |
@@ -366,6 +367,14 @@ void ceph_con_open(struct ceph_connection *con, struct ceph_entity_addr *addr) | |||
366 | } | 367 | } |
367 | 368 | ||
368 | /* | 369 | /* |
370 | * return true if this connection ever successfully opened | ||
371 | */ | ||
372 | bool ceph_con_opened(struct ceph_connection *con) | ||
373 | { | ||
374 | return con->connect_seq > 0; | ||
375 | } | ||
376 | |||
377 | /* | ||
369 | * generic get/put | 378 | * generic get/put |
370 | */ | 379 | */ |
371 | struct ceph_connection *ceph_con_get(struct ceph_connection *con) | 380 | struct ceph_connection *ceph_con_get(struct ceph_connection *con) |
@@ -830,13 +839,6 @@ static void prepare_read_connect(struct ceph_connection *con) | |||
830 | con->in_base_pos = 0; | 839 | con->in_base_pos = 0; |
831 | } | 840 | } |
832 | 841 | ||
833 | static void prepare_read_connect_retry(struct ceph_connection *con) | ||
834 | { | ||
835 | dout("prepare_read_connect_retry %p\n", con); | ||
836 | con->in_base_pos = strlen(CEPH_BANNER) + sizeof(con->actual_peer_addr) | ||
837 | + sizeof(con->peer_addr_for_me); | ||
838 | } | ||
839 | |||
840 | static void prepare_read_ack(struct ceph_connection *con) | 842 | static void prepare_read_ack(struct ceph_connection *con) |
841 | { | 843 | { |
842 | dout("prepare_read_ack %p\n", con); | 844 | dout("prepare_read_ack %p\n", con); |
@@ -1146,7 +1148,7 @@ static int process_connect(struct ceph_connection *con) | |||
1146 | } | 1148 | } |
1147 | con->auth_retry = 1; | 1149 | con->auth_retry = 1; |
1148 | prepare_write_connect(con->msgr, con, 0); | 1150 | prepare_write_connect(con->msgr, con, 0); |
1149 | prepare_read_connect_retry(con); | 1151 | prepare_read_connect(con); |
1150 | break; | 1152 | break; |
1151 | 1153 | ||
1152 | case CEPH_MSGR_TAG_RESETSESSION: | 1154 | case CEPH_MSGR_TAG_RESETSESSION: |
@@ -1843,8 +1845,6 @@ static void ceph_fault(struct ceph_connection *con) | |||
1843 | goto out; | 1845 | goto out; |
1844 | } | 1846 | } |
1845 | 1847 | ||
1846 | clear_bit(BUSY, &con->state); /* to avoid an improbable race */ | ||
1847 | |||
1848 | mutex_lock(&con->mutex); | 1848 | mutex_lock(&con->mutex); |
1849 | if (test_bit(CLOSED, &con->state)) | 1849 | if (test_bit(CLOSED, &con->state)) |
1850 | goto out_unlock; | 1850 | goto out_unlock; |