diff options
author | Yehuda Sadeh <yehuda@hq.newdream.net> | 2010-01-13 20:03:23 -0500 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-01-25 15:58:08 -0500 |
commit | 0d59ab81c3d3adf466c3fd37d7fb6d46b05d1fd4 (patch) | |
tree | 1cdf338188bc323379ced8d5e1bdec31f500768c /fs/ceph/messenger.c | |
parent | 0547a9b30a5ac8680325752b61d3ffa9d4971b6e (diff) |
ceph: keep reserved replies on the request structure
This includes treating all the data preallocation and revokation
at the same place, not having to have a special case for
the reserved pages.
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
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 f708803e6857..81bc779adb90 100644 --- a/fs/ceph/messenger.c +++ b/fs/ceph/messenger.c | |||
@@ -1985,30 +1985,30 @@ void ceph_con_revoke(struct ceph_connection *con, struct ceph_msg *msg) | |||
1985 | } | 1985 | } |
1986 | 1986 | ||
1987 | /* | 1987 | /* |
1988 | * Revoke a page vector that we may be reading data into | 1988 | * Revoke a message that we may be reading data into |
1989 | */ | 1989 | */ |
1990 | void ceph_con_revoke_pages(struct ceph_connection *con, struct page **pages) | 1990 | void ceph_con_revoke_message(struct ceph_connection *con, struct ceph_msg *msg) |
1991 | { | 1991 | { |
1992 | mutex_lock(&con->mutex); | 1992 | mutex_lock(&con->mutex); |
1993 | if (con->in_msg && con->in_msg->pages == pages) { | 1993 | if (con->in_msg && con->in_msg == msg) { |
1994 | unsigned front_len = le32_to_cpu(con->in_hdr.front_len); | ||
1995 | unsigned middle_len = le32_to_cpu(con->in_hdr.middle_len); | ||
1994 | unsigned data_len = le32_to_cpu(con->in_hdr.data_len); | 1996 | unsigned data_len = le32_to_cpu(con->in_hdr.data_len); |
1995 | 1997 | ||
1996 | /* skip rest of message */ | 1998 | /* skip rest of message */ |
1997 | dout("con_revoke_pages %p msg %p pages %p revoked\n", con, | 1999 | dout("con_revoke_pages %p msg %p revoked\n", con, msg); |
1998 | con->in_msg, pages); | ||
1999 | if (con->in_msg_pos.data_pos < data_len) | ||
2000 | con->in_base_pos = con->in_msg_pos.data_pos - data_len; | ||
2001 | else | ||
2002 | con->in_base_pos = con->in_base_pos - | 2000 | con->in_base_pos = con->in_base_pos - |
2003 | sizeof(struct ceph_msg_header) - | 2001 | sizeof(struct ceph_msg_header) - |
2002 | front_len - | ||
2003 | middle_len - | ||
2004 | data_len - | ||
2004 | sizeof(struct ceph_msg_footer); | 2005 | sizeof(struct ceph_msg_footer); |
2005 | con->in_msg->pages = NULL; | ||
2006 | ceph_msg_put(con->in_msg); | 2006 | ceph_msg_put(con->in_msg); |
2007 | con->in_msg = NULL; | 2007 | con->in_msg = NULL; |
2008 | con->in_tag = CEPH_MSGR_TAG_READY; | 2008 | con->in_tag = CEPH_MSGR_TAG_READY; |
2009 | } else { | 2009 | } else { |
2010 | dout("con_revoke_pages %p msg %p pages %p no-op\n", | 2010 | dout("con_revoke_pages %p msg %p pages %p no-op\n", |
2011 | con, con->in_msg, pages); | 2011 | con, con->in_msg, msg); |
2012 | } | 2012 | } |
2013 | mutex_unlock(&con->mutex); | 2013 | mutex_unlock(&con->mutex); |
2014 | } | 2014 | } |