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>
This commit is contained in:
parent
0d09c57d08
commit
26df726bcd
|
@ -2320,11 +2320,13 @@ static void finish_request(struct ceph_osd_request *req)
|
||||||
|
|
||||||
static void __complete_request(struct ceph_osd_request *req)
|
static void __complete_request(struct ceph_osd_request *req)
|
||||||
{
|
{
|
||||||
if (req->r_callback) {
|
dout("%s req %p tid %llu cb %pf result %d\n", __func__, req,
|
||||||
dout("%s req %p tid %llu cb %pf result %d\n", __func__, req,
|
req->r_tid, req->r_callback, req->r_result);
|
||||||
req->r_tid, req->r_callback, req->r_result);
|
|
||||||
|
if (req->r_callback)
|
||||||
req->r_callback(req);
|
req->r_callback(req);
|
||||||
}
|
complete_all(&req->r_completion);
|
||||||
|
ceph_osdc_put_request(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2337,8 +2339,6 @@ static void complete_request(struct ceph_osd_request *req, int err)
|
||||||
req->r_result = err;
|
req->r_result = err;
|
||||||
finish_request(req);
|
finish_request(req);
|
||||||
__complete_request(req);
|
__complete_request(req);
|
||||||
complete_all(&req->r_completion);
|
|
||||||
ceph_osdc_put_request(req);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cancel_map_check(struct ceph_osd_request *req)
|
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)
|
||||||
up_read(&osdc->lock);
|
up_read(&osdc->lock);
|
||||||
|
|
||||||
__complete_request(req);
|
__complete_request(req);
|
||||||
complete_all(&req->r_completion);
|
|
||||||
ceph_osdc_put_request(req);
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fail_request:
|
fail_request:
|
||||||
|
|
Loading…
Reference in a new issue