summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-03-25 23:16:11 (GMT)
committerSage Weil <sage@inktank.com>2013-05-02 04:17:16 (GMT)
commitdc4b870c97a5006871c259f7e61ea6c79038f731 (patch)
tree9da66c4b95edd3ae944fb9c8292b2feee4b357fa /net
parente9966076cdd952e19f2dd4854cd719be0d7cbebc (diff)
downloadlinux-fsl-qoriq-dc4b870c97a5006871c259f7e61ea6c79038f731.tar.xz
libceph: slightly defer registering osd request
One of the first things ceph_osdc_start_request() does is register the request. It then acquires the osd client's map semaphore and request mutex and proceeds to map and send the request. There is no reason the request has to be registered before acquiring the map semaphore. So hold off doing so until after the map semaphore is held. Since register_request() is nothing more than a wrapper around __register_request(), call the latter function instead, after acquiring the request mutex. That leaves register_request() unused, so get rid of it. This partially resolves: http://tracker.ceph.com/issues/4392 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/osd_client.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 7041906..f9276cb 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -831,14 +831,6 @@ static void __register_request(struct ceph_osd_client *osdc,
}
}
-static void register_request(struct ceph_osd_client *osdc,
- struct ceph_osd_request *req)
-{
- mutex_lock(&osdc->request_mutex);
- __register_request(osdc, req);
- mutex_unlock(&osdc->request_mutex);
-}
-
/*
* called under osdc->request_mutex
*/
@@ -1785,8 +1777,6 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc,
ceph_osdc_msg_data_set(req->r_reply, &req->r_data_in);
ceph_osdc_msg_data_set(req->r_request, &req->r_data_out);
- register_request(osdc, req);
-
down_read(&osdc->map_sem);
mutex_lock(&osdc->request_mutex);
/*
@@ -1794,6 +1784,7 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc,
* while we dropped request_mutex above, so only send now if
* the request still han't been touched yet.
*/
+ __register_request(osdc, req);
if (req->r_sent == 0) {
rc = __map_request(osdc, req, 0);
if (rc < 0) {