提交 c622d226 编写于 作者: G Guangliang Zhao 提交者: Ilya Dryomov

rbd: skip the copyup when an entire object writing

It need to copyup the parent's content when layered writing,
but an entire object write would overwrite it, so skip it.
Signed-off-by: NGuangliang Zhao <lucienchao@gmail.com>
Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
Reviewed-by: NAlex Elder <elder@linaro.org>
上级 70d045f6
...@@ -2769,6 +2769,14 @@ static bool img_obj_request_simple(struct rbd_obj_request *obj_request) ...@@ -2769,6 +2769,14 @@ static bool img_obj_request_simple(struct rbd_obj_request *obj_request)
if (!obj_request_overlaps_parent(obj_request)) if (!obj_request_overlaps_parent(obj_request))
return true; return true;
/*
* Entire-object layered writes - we will overwrite whatever
* parent data there is anyway.
*/
if (!obj_request->offset &&
obj_request->length == rbd_obj_bytes(&rbd_dev->header))
return true;
/* /*
* If the object is known to already exist, its parent data has * If the object is known to already exist, its parent data has
* already been copied. * already been copied.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册