Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320274
b: refs/heads/master
c: 8921d11
h: refs/heads/master
v: v3
  • Loading branch information
Alex Elder authored and Alex Elder committed Jun 6, 2012
1 parent 64473ab commit 607cb57
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 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: 6740a845b2543cc46e1902ba21bac743fbadd0dc
refs/heads/master: 8921d114f5574c6da2cdd00749d185633ecf88f3
4 changes: 2 additions & 2 deletions trunk/include/linux/ceph/messenger.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ extern void ceph_con_close(struct ceph_connection *con);
extern void ceph_con_send(struct ceph_connection *con, struct ceph_msg *msg);

extern void ceph_msg_revoke(struct ceph_msg *msg);
extern void ceph_con_revoke_message(struct ceph_connection *con,
struct ceph_msg *msg);
extern void ceph_msg_revoke_incoming(struct ceph_msg *msg);

extern void ceph_con_keepalive(struct ceph_connection *con);
extern struct ceph_connection *ceph_con_get(struct ceph_connection *con);
extern void ceph_con_put(struct ceph_connection *con);
Expand Down
22 changes: 16 additions & 6 deletions trunk/net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -2456,17 +2456,27 @@ void ceph_msg_revoke(struct ceph_msg *msg)
/*
* Revoke a message that we may be reading data into
*/
void ceph_con_revoke_message(struct ceph_connection *con, struct ceph_msg *msg)
void ceph_msg_revoke_incoming(struct ceph_msg *msg)
{
struct ceph_connection *con;

BUG_ON(msg == NULL);
if (!msg->con) {
dout("%s msg %p null con\n", __func__, msg);

return; /* Message not in our possession */
}

con = msg->con;
mutex_lock(&con->mutex);
if (con->in_msg && con->in_msg == msg) {
if (con->in_msg == msg) {
unsigned front_len = le32_to_cpu(con->in_hdr.front_len);
unsigned middle_len = le32_to_cpu(con->in_hdr.middle_len);
unsigned data_len = le32_to_cpu(con->in_hdr.data_len);

/* skip rest of message */
dout("con_revoke_pages %p msg %p revoked\n", con, msg);
con->in_base_pos = con->in_base_pos -
dout("%s %p msg %p revoked\n", __func__, con, msg);
con->in_base_pos = con->in_base_pos -
sizeof(struct ceph_msg_header) -
front_len -
middle_len -
Expand All @@ -2477,8 +2487,8 @@ void ceph_con_revoke_message(struct ceph_connection *con, struct ceph_msg *msg)
con->in_tag = CEPH_MSGR_TAG_READY;
con->in_seq++;
} else {
dout("con_revoke_pages %p msg %p pages %p no-op\n",
con, con->in_msg, msg);
dout("%s %p in_msg %p msg %p no-op\n",
__func__, con, con->in_msg, msg);
}
mutex_unlock(&con->mutex);
}
Expand Down
9 changes: 4 additions & 5 deletions trunk/net/ceph/osd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,9 @@ void ceph_osdc_release_request(struct kref *kref)
if (req->r_request)
ceph_msg_put(req->r_request);
if (req->r_con_filling_msg) {
dout("release_request revoking pages %p from con %p\n",
dout("%s revoking pages %p from con %p\n", __func__,
req->r_pages, req->r_con_filling_msg);
ceph_con_revoke_message(req->r_con_filling_msg,
req->r_reply);
ceph_msg_revoke_incoming(req->r_reply);
req->r_con_filling_msg->ops->put(req->r_con_filling_msg);
}
if (req->r_reply)
Expand Down Expand Up @@ -2022,9 +2021,9 @@ static struct ceph_msg *get_reply(struct ceph_connection *con,
}

if (req->r_con_filling_msg) {
dout("get_reply revoking msg %p from old con %p\n",
dout("%s revoking msg %p from old con %p\n", __func__,
req->r_reply, req->r_con_filling_msg);
ceph_con_revoke_message(req->r_con_filling_msg, req->r_reply);
ceph_msg_revoke_incoming(req->r_reply);
req->r_con_filling_msg->ops->put(req->r_con_filling_msg);
req->r_con_filling_msg = NULL;
}
Expand Down

0 comments on commit 607cb57

Please sign in to comment.