diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2018-05-21 09:33:48 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2018-06-04 14:45:58 -0400 |
commit | 26df726bcdfacf69335de716e7b78c517bc1df65 (patch) | |
tree | 730f24bfcb97bca2460e92928ed29bcb47656493 /net | |
parent | 0d09c57d0846537332d3649eef7e01960ffdc574 (diff) |
libceph: move more code into __complete_request()
Move req->r_completion wake up and req->r_kref decrement into
__complete_request().
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/ceph/osd_client.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index bcedeea80cd5..a78f578a2da7 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -2320,11 +2320,13 @@ static void finish_request(struct ceph_osd_request *req) | |||
2320 | 2320 | ||
2321 | static void __complete_request(struct ceph_osd_request *req) | 2321 | static void __complete_request(struct ceph_osd_request *req) |
2322 | { | 2322 | { |
2323 | if (req->r_callback) { | 2323 | dout("%s req %p tid %llu cb %pf result %d\n", __func__, req, |
2324 | dout("%s req %p tid %llu cb %pf result %d\n", __func__, req, | 2324 | req->r_tid, req->r_callback, req->r_result); |
2325 | req->r_tid, req->r_callback, req->r_result); | 2325 | |
2326 | if (req->r_callback) | ||
2326 | req->r_callback(req); | 2327 | req->r_callback(req); |
2327 | } | 2328 | complete_all(&req->r_completion); |
2329 | ceph_osdc_put_request(req); | ||
2328 | } | 2330 | } |
2329 | 2331 | ||
2330 | /* | 2332 | /* |
@@ -2337,8 +2339,6 @@ static void complete_request(struct ceph_osd_request *req, int err) | |||
2337 | req->r_result = err; | 2339 | req->r_result = err; |
2338 | finish_request(req); | 2340 | finish_request(req); |
2339 | __complete_request(req); | 2341 | __complete_request(req); |
2340 | complete_all(&req->r_completion); | ||
2341 | ceph_osdc_put_request(req); | ||
2342 | } | 2342 | } |
2343 | 2343 | ||
2344 | static void cancel_map_check(struct ceph_osd_request *req) | 2344 | static void cancel_map_check(struct ceph_osd_request *req) |
@@ -3602,8 +3602,6 @@ static void handle_reply(struct ceph_osd *osd, struct ceph_msg *msg) | |||
3602 | up_read(&osdc->lock); | 3602 | up_read(&osdc->lock); |
3603 | 3603 | ||
3604 | __complete_request(req); | 3604 | __complete_request(req); |
3605 | complete_all(&req->r_completion); | ||
3606 | ceph_osdc_put_request(req); | ||
3607 | return; | 3605 | return; |
3608 | 3606 | ||
3609 | fail_request: | 3607 | fail_request: |