From 92d0bbe1cb00bcb061c5485e8a82a39c150b8bfe Mon Sep 17 00:00:00 2001 From: Ma Jianpeng Date: Wed, 30 Jul 2014 11:38:37 +0800 Subject: [PATCH] ECBackend: Using ROUND_UP_TO to refactor function get_recovery_chunk_size() Signed-off-by: Ma Jianpeng --- src/osd/ECBackend.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/osd/ECBackend.h b/src/osd/ECBackend.h index 28bcf8a50954..0e964070e499 100644 --- a/src/osd/ECBackend.h +++ b/src/osd/ECBackend.h @@ -149,10 +149,8 @@ public: private: friend struct ECRecoveryHandle; uint64_t get_recovery_chunk_size() const { - uint64_t max = cct->_conf->osd_recovery_max_chunk; - max -= max % sinfo.get_stripe_width(); - max += sinfo.get_stripe_width(); - return max; + return ROUND_UP_TO(cct->_conf->osd_recovery_max_chunk, + sinfo.get_stripe_width()); } /** -- 2.47.3