Commit 2b2300d6 authored by Sage Weil's avatar Sage Weil

ceph: try to send partial cap release on cap message on missing inode

If we have enough memory to allocate a new cap release message, do so, so
that we can send a partial release message immediately.  This keeps us from
making the MDS wait when the cap release it needs is in a partially full
release message.

If we fail because of ENOMEM, oh well, they'll just have to wait a bit
longer.
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 3d7ded4d
...@@ -2708,6 +2708,7 @@ void ceph_handle_caps(struct ceph_mds_session *session, ...@@ -2708,6 +2708,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
* along for the mds (who clearly thinks we still have this * along for the mds (who clearly thinks we still have this
* cap). * cap).
*/ */
ceph_add_cap_releases(mdsc, session, -1);
ceph_send_cap_releases(mdsc, session); ceph_send_cap_releases(mdsc, session);
goto done; goto done;
} }
......
...@@ -1066,9 +1066,9 @@ static int trim_caps(struct ceph_mds_client *mdsc, ...@@ -1066,9 +1066,9 @@ static int trim_caps(struct ceph_mds_client *mdsc,
* *
* Called under s_mutex. * Called under s_mutex.
*/ */
static int add_cap_releases(struct ceph_mds_client *mdsc, int ceph_add_cap_releases(struct ceph_mds_client *mdsc,
struct ceph_mds_session *session, struct ceph_mds_session *session,
int extra) int extra)
{ {
struct ceph_msg *msg; struct ceph_msg *msg;
struct ceph_mds_cap_release *head; struct ceph_mds_cap_release *head;
...@@ -1980,7 +1980,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) ...@@ -1980,7 +1980,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
} }
mutex_unlock(&mdsc->mutex); mutex_unlock(&mdsc->mutex);
add_cap_releases(mdsc, req->r_session, -1); ceph_add_cap_releases(mdsc, req->r_session, -1);
mutex_unlock(&session->s_mutex); mutex_unlock(&session->s_mutex);
/* kick calling process */ /* kick calling process */
...@@ -2690,7 +2690,7 @@ static void delayed_work(struct work_struct *work) ...@@ -2690,7 +2690,7 @@ static void delayed_work(struct work_struct *work)
send_renew_caps(mdsc, s); send_renew_caps(mdsc, s);
else else
ceph_con_keepalive(&s->s_con); ceph_con_keepalive(&s->s_con);
add_cap_releases(mdsc, s, -1); ceph_add_cap_releases(mdsc, s, -1);
if (s->s_state == CEPH_MDS_SESSION_OPEN || if (s->s_state == CEPH_MDS_SESSION_OPEN ||
s->s_state == CEPH_MDS_SESSION_HUNG) s->s_state == CEPH_MDS_SESSION_HUNG)
ceph_send_cap_releases(mdsc, s); ceph_send_cap_releases(mdsc, s);
......
...@@ -322,6 +322,9 @@ static inline void ceph_mdsc_put_request(struct ceph_mds_request *req) ...@@ -322,6 +322,9 @@ static inline void ceph_mdsc_put_request(struct ceph_mds_request *req)
kref_put(&req->r_kref, ceph_mdsc_release_request); kref_put(&req->r_kref, ceph_mdsc_release_request);
} }
extern int ceph_add_cap_releases(struct ceph_mds_client *mdsc,
struct ceph_mds_session *session,
int extra);
extern void ceph_send_cap_releases(struct ceph_mds_client *mdsc, extern void ceph_send_cap_releases(struct ceph_mds_client *mdsc,
struct ceph_mds_session *session); struct ceph_mds_session *session);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment