]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ECBackend: Using ROUND_UP_TO to refactor function get_recovery_chunk_size() 2183/head
authorMa Jianpeng <jianpeng.ma@intel.com>
Wed, 30 Jul 2014 03:38:37 +0000 (11:38 +0800)
committerMa Jianpeng <jianpeng.ma@intel.com>
Fri, 1 Aug 2014 00:32:23 +0000 (08:32 +0800)
Signed-off-by: Ma Jianpeng <jianpeng.ma@intel.com>
src/osd/ECBackend.h

index 28bcf8a50954f56b8e971934b8e47e0283fe2176..0e964070e4993d95dcb96c207d80ee9a17bebe6f 100644 (file)
@@ -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());
   }
 
   /**