From: Guangliang Zhao Date: Tue, 1 Apr 2014 14:22:15 +0000 (+0800) Subject: rbd: skip the copyup when an entire object writing X-Git-Tag: v4.9.8~5518^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c622d226155b12276ae3d29d546f4b314d7cd68c;p=platform%2Fkernel%2Flinux-rpi3.git 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: Guangliang Zhao Reviewed-by: Josh Durgin Reviewed-by: Alex Elder --- diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 6dae658..16eb247 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2770,6 +2770,14 @@ static bool img_obj_request_simple(struct rbd_obj_request *obj_request) 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 * already been copied. */