aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-06-09 19:52:04 -0400
committerSage Weil <sage@newdream.net>2010-06-10 16:30:25 -0400
commit2b2300d62ea413bec631d5b880effa2cc5363acb (patch)
tree50707a1b8a547d781dc23fd830c23d580671c8a8 /fs
parent3d7ded4d81d807c2f75f310a8d74a5d72be13a1b (diff)
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: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/caps.c1
-rw-r--r--fs/ceph/mds_client.c10
-rw-r--r--fs/ceph/mds_client.h3
3 files changed, 9 insertions, 5 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 7c692e746237..619b61655ee5 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2708,6 +2708,7 @@ void ceph_handle_caps(struct ceph_mds_session *session,
2708 * along for the mds (who clearly thinks we still have this 2708 * along for the mds (who clearly thinks we still have this
2709 * cap). 2709 * cap).
2710 */ 2710 */
2711 ceph_add_cap_releases(mdsc, session, -1);
2711 ceph_send_cap_releases(mdsc, session); 2712 ceph_send_cap_releases(mdsc, session);
2712 goto done; 2713 goto done;
2713 } 2714 }
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index d28b6a9c0f96..1766947fc07a 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -1066,9 +1066,9 @@ static int trim_caps(struct ceph_mds_client *mdsc,
1066 * 1066 *
1067 * Called under s_mutex. 1067 * Called under s_mutex.
1068 */ 1068 */
1069static int add_cap_releases(struct ceph_mds_client *mdsc, 1069int ceph_add_cap_releases(struct ceph_mds_client *mdsc,
1070 struct ceph_mds_session *session, 1070 struct ceph_mds_session *session,
1071 int extra) 1071 int extra)
1072{ 1072{
1073 struct ceph_msg *msg; 1073 struct ceph_msg *msg;
1074 struct ceph_mds_cap_release *head; 1074 struct ceph_mds_cap_release *head;
@@ -1980,7 +1980,7 @@ out_err:
1980 } 1980 }
1981 mutex_unlock(&mdsc->mutex); 1981 mutex_unlock(&mdsc->mutex);
1982 1982
1983 add_cap_releases(mdsc, req->r_session, -1); 1983 ceph_add_cap_releases(mdsc, req->r_session, -1);
1984 mutex_unlock(&session->s_mutex); 1984 mutex_unlock(&session->s_mutex);
1985 1985
1986 /* kick calling process */ 1986 /* kick calling process */
@@ -2690,7 +2690,7 @@ static void delayed_work(struct work_struct *work)
2690 send_renew_caps(mdsc, s); 2690 send_renew_caps(mdsc, s);
2691 else 2691 else
2692 ceph_con_keepalive(&s->s_con); 2692 ceph_con_keepalive(&s->s_con);
2693 add_cap_releases(mdsc, s, -1); 2693 ceph_add_cap_releases(mdsc, s, -1);
2694 if (s->s_state == CEPH_MDS_SESSION_OPEN || 2694 if (s->s_state == CEPH_MDS_SESSION_OPEN ||
2695 s->s_state == CEPH_MDS_SESSION_HUNG) 2695 s->s_state == CEPH_MDS_SESSION_HUNG)
2696 ceph_send_cap_releases(mdsc, s); 2696 ceph_send_cap_releases(mdsc, s);
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h
index e43752b52635..b292fa42a66d 100644
--- a/fs/ceph/mds_client.h
+++ b/fs/ceph/mds_client.h
@@ -322,6 +322,9 @@ static inline void ceph_mdsc_put_request(struct ceph_mds_request *req)
322 kref_put(&req->r_kref, ceph_mdsc_release_request); 322 kref_put(&req->r_kref, ceph_mdsc_release_request);
323} 323}
324 324
325extern int ceph_add_cap_releases(struct ceph_mds_client *mdsc,
326 struct ceph_mds_session *session,
327 int extra);
325extern void ceph_send_cap_releases(struct ceph_mds_client *mdsc, 328extern void ceph_send_cap_releases(struct ceph_mds_client *mdsc,
326 struct ceph_mds_session *session); 329 struct ceph_mds_session *session);
327 330