提交 980917fc 编写于 作者: I Ilya Dryomov

rbd: change rbd_obj_request_submit() signature

- osdc parameter is useless
- starting with commit 5aea3dcd ("libceph: a major OSD client
  update"), ceph_osdc_start_request() always returns success
Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
Reviewed-by: NAlex Elder <elder@linaro.org>
Reviewed-by: NDavid Disseldorp <ddiss@suse.de>
上级 80de1912
...@@ -1618,11 +1618,12 @@ static bool obj_request_type_valid(enum obj_request_type type) ...@@ -1618,11 +1618,12 @@ static bool obj_request_type_valid(enum obj_request_type type)
} }
} }
static int rbd_obj_request_submit(struct ceph_osd_client *osdc, static void rbd_obj_request_submit(struct rbd_obj_request *obj_request)
struct rbd_obj_request *obj_request)
{ {
dout("%s %p\n", __func__, obj_request); struct ceph_osd_request *osd_req = obj_request->osd_req;
return ceph_osdc_start_request(osdc, obj_request->osd_req, false);
dout("%s %p osd_req %p\n", __func__, obj_request, osd_req);
ceph_osdc_start_request(osd_req->r_osdc, osd_req, false);
} }
static void rbd_obj_request_end(struct rbd_obj_request *obj_request) static void rbd_obj_request_end(struct rbd_obj_request *obj_request)
...@@ -2646,7 +2647,6 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request) ...@@ -2646,7 +2647,6 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request)
{ {
struct rbd_obj_request *orig_request; struct rbd_obj_request *orig_request;
struct ceph_osd_request *osd_req; struct ceph_osd_request *osd_req;
struct ceph_osd_client *osdc;
struct rbd_device *rbd_dev; struct rbd_device *rbd_dev;
struct page **pages; struct page **pages;
enum obj_operation_type op_type; enum obj_operation_type op_type;
...@@ -2683,13 +2683,9 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request) ...@@ -2683,13 +2683,9 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request)
* and re-submit the original write request. * and re-submit the original write request.
*/ */
if (!rbd_dev->parent_overlap) { if (!rbd_dev->parent_overlap) {
struct ceph_osd_client *osdc;
ceph_release_page_vector(pages, page_count); ceph_release_page_vector(pages, page_count);
osdc = &rbd_dev->rbd_client->client->osdc; rbd_obj_request_submit(orig_request);
img_result = rbd_obj_request_submit(osdc, orig_request); return;
if (!img_result)
return;
} }
if (img_result) if (img_result)
...@@ -2723,10 +2719,9 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request) ...@@ -2723,10 +2719,9 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request)
/* All set, send it off. */ /* All set, send it off. */
osdc = &rbd_dev->rbd_client->client->osdc; rbd_obj_request_submit(orig_request);
img_result = rbd_obj_request_submit(osdc, orig_request); return;
if (!img_result)
return;
out_err: out_err:
/* Record the error code and complete the request */ /* Record the error code and complete the request */
...@@ -2860,17 +2855,13 @@ static void rbd_img_obj_exists_callback(struct rbd_obj_request *obj_request) ...@@ -2860,17 +2855,13 @@ static void rbd_img_obj_exists_callback(struct rbd_obj_request *obj_request)
/* /*
* If the overlap has become 0 (most likely because the * If the overlap has become 0 (most likely because the
* image has been flattened) we need to free the pages * image has been flattened) we need to re-submit the
* and re-submit the original write request. * original request.
*/ */
rbd_dev = orig_request->img_request->rbd_dev; rbd_dev = orig_request->img_request->rbd_dev;
if (!rbd_dev->parent_overlap) { if (!rbd_dev->parent_overlap) {
struct ceph_osd_client *osdc; rbd_obj_request_submit(orig_request);
return;
osdc = &rbd_dev->rbd_client->client->osdc;
result = rbd_obj_request_submit(osdc, orig_request);
if (!result)
return;
} }
/* /*
...@@ -2902,7 +2893,6 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request) ...@@ -2902,7 +2893,6 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
{ {
struct rbd_obj_request *stat_request; struct rbd_obj_request *stat_request;
struct rbd_device *rbd_dev; struct rbd_device *rbd_dev;
struct ceph_osd_client *osdc;
struct page **pages = NULL; struct page **pages = NULL;
u32 page_count; u32 page_count;
size_t size; size_t size;
...@@ -2946,8 +2936,9 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request) ...@@ -2946,8 +2936,9 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
false, false); false, false);
rbd_osd_req_format_read(stat_request); rbd_osd_req_format_read(stat_request);
osdc = &rbd_dev->rbd_client->client->osdc; rbd_obj_request_submit(stat_request);
ret = rbd_obj_request_submit(osdc, stat_request); return 0;
out: out:
if (ret) if (ret)
rbd_obj_request_put(obj_request); rbd_obj_request_put(obj_request);
...@@ -3004,13 +2995,8 @@ static bool img_obj_request_simple(struct rbd_obj_request *obj_request) ...@@ -3004,13 +2995,8 @@ static bool img_obj_request_simple(struct rbd_obj_request *obj_request)
static int rbd_img_obj_request_submit(struct rbd_obj_request *obj_request) static int rbd_img_obj_request_submit(struct rbd_obj_request *obj_request)
{ {
if (img_obj_request_simple(obj_request)) { if (img_obj_request_simple(obj_request)) {
struct rbd_device *rbd_dev; rbd_obj_request_submit(obj_request);
struct ceph_osd_client *osdc; return 0;
rbd_dev = obj_request->img_request->rbd_dev;
osdc = &rbd_dev->rbd_client->client->osdc;
return rbd_obj_request_submit(osdc, obj_request);
} }
/* /*
...@@ -3073,12 +3059,8 @@ static void rbd_img_parent_read_callback(struct rbd_img_request *img_request) ...@@ -3073,12 +3059,8 @@ static void rbd_img_parent_read_callback(struct rbd_img_request *img_request)
rbd_assert(obj_request->img_request); rbd_assert(obj_request->img_request);
rbd_dev = obj_request->img_request->rbd_dev; rbd_dev = obj_request->img_request->rbd_dev;
if (!rbd_dev->parent_overlap) { if (!rbd_dev->parent_overlap) {
struct ceph_osd_client *osdc; rbd_obj_request_submit(obj_request);
return;
osdc = &rbd_dev->rbd_client->client->osdc;
img_result = rbd_obj_request_submit(osdc, obj_request);
if (!img_result)
return;
} }
obj_request->result = img_result; obj_request->result = img_result;
...@@ -4005,7 +3987,6 @@ static int rbd_obj_method_sync(struct rbd_device *rbd_dev, ...@@ -4005,7 +3987,6 @@ static int rbd_obj_method_sync(struct rbd_device *rbd_dev,
void *inbound, void *inbound,
size_t inbound_size) size_t inbound_size)
{ {
struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;
struct rbd_obj_request *obj_request; struct rbd_obj_request *obj_request;
struct page **pages; struct page **pages;
u32 page_count; u32 page_count;
...@@ -4056,9 +4037,7 @@ static int rbd_obj_method_sync(struct rbd_device *rbd_dev, ...@@ -4056,9 +4037,7 @@ static int rbd_obj_method_sync(struct rbd_device *rbd_dev,
0, false, false); 0, false, false);
rbd_osd_req_format_read(obj_request); rbd_osd_req_format_read(obj_request);
ret = rbd_obj_request_submit(osdc, obj_request); rbd_obj_request_submit(obj_request);
if (ret)
goto out;
ret = rbd_obj_request_wait(obj_request); ret = rbd_obj_request_wait(obj_request);
if (ret) if (ret)
goto out; goto out;
...@@ -4266,7 +4245,6 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev, ...@@ -4266,7 +4245,6 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev,
u64 offset, u64 length, void *buf) u64 offset, u64 length, void *buf)
{ {
struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;
struct rbd_obj_request *obj_request; struct rbd_obj_request *obj_request;
struct page **pages = NULL; struct page **pages = NULL;
u32 page_count; u32 page_count;
...@@ -4301,9 +4279,7 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev, ...@@ -4301,9 +4279,7 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev,
false, false); false, false);
rbd_osd_req_format_read(obj_request); rbd_osd_req_format_read(obj_request);
ret = rbd_obj_request_submit(osdc, obj_request); rbd_obj_request_submit(obj_request);
if (ret)
goto out;
ret = rbd_obj_request_wait(obj_request); ret = rbd_obj_request_wait(obj_request);
if (ret) if (ret)
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册