aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorGuangliang Zhao <lucienchao@gmail.com>2014-04-01 10:22:15 -0400
committerIlya Dryomov <idryomov@redhat.com>2014-10-14 13:03:29 -0400
commitc622d226155b12276ae3d29d546f4b314d7cd68c (patch)
treece4463c5d7f0b6f53237c184b4d18db3f55826ef /drivers/block
parent70d045f660c7331bce8c9377929b52a9738a12cb (diff)
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 <lucienchao@gmail.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 6dae6586a8a9..16eb247cb5fb 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)
2770 return true; 2770 return true;
2771 2771
2772 /* 2772 /*
2773 * Entire-object layered writes - we will overwrite whatever
2774 * parent data there is anyway.
2775 */
2776 if (!obj_request->offset &&
2777 obj_request->length == rbd_obj_bytes(&rbd_dev->header))
2778 return true;
2779
2780 /*
2773 * If the object is known to already exist, its parent data has 2781 * If the object is known to already exist, its parent data has
2774 * already been copied. 2782 * already been copied.
2775 */ 2783 */