Skip to content

Commit

Permalink
ceph: clean up cap release loop vs spinlock
Browse files Browse the repository at this point in the history
Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed May 17, 2010
1 parent 31e0cf8 commit 0f8605f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1143,17 +1143,16 @@ static void send_cap_releases(struct ceph_mds_client *mdsc,
struct ceph_msg *msg;

dout("send_cap_releases mds%d\n", session->s_mds);
while (1) {
spin_lock(&session->s_cap_lock);
if (list_empty(&session->s_cap_releases_done))
break;
spin_lock(&session->s_cap_lock);
while (!list_empty(&session->s_cap_releases_done)) {
msg = list_first_entry(&session->s_cap_releases_done,
struct ceph_msg, list_head);
list_del_init(&msg->list_head);
spin_unlock(&session->s_cap_lock);
msg->hdr.front_len = cpu_to_le32(msg->front.iov_len);
dout("send_cap_releases mds%d %p\n", session->s_mds, msg);
ceph_con_send(&session->s_con, msg);
spin_lock(&session->s_cap_lock);
}
spin_unlock(&session->s_cap_lock);
}
Expand Down

0 comments on commit 0f8605f

Please sign in to comment.