From patchwork Wed Jul 30 06:12:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ma, Jianpeng" X-Patchwork-Id: 4646011 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id ACF5FC0338 for ; Wed, 30 Jul 2014 06:12:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 637342012B for ; Wed, 30 Jul 2014 06:12:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 866E720127 for ; Wed, 30 Jul 2014 06:12:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751463AbaG3GMi (ORCPT ); Wed, 30 Jul 2014 02:12:38 -0400 Received: from mga03.intel.com ([143.182.124.21]:57202 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751155AbaG3GMh convert rfc822-to-8bit (ORCPT ); Wed, 30 Jul 2014 02:12:37 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 29 Jul 2014 23:12:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,762,1400050800"; d="scan'208";a="463004054" Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35]) by azsmga001.ch.intel.com with ESMTP; 29 Jul 2014 23:12:36 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 29 Jul 2014 23:12:36 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 29 Jul 2014 23:12:35 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.52]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.26]) with mapi id 14.03.0123.003; Wed, 30 Jul 2014 14:12:28 +0800 From: "Ma, Jianpeng" To: "sage@redhat.com" CC: "ceph-devel@vger.kernel.org" Subject: [PATCH]ECBackend: Using ROUND_UP_TO to refactor get_recovery_chunk_size() Thread-Topic: [PATCH]ECBackend: Using ROUND_UP_TO to refactor get_recovery_chunk_size() Thread-Index: Ac+rvTqj39VYq89DSOC/X9eaZ0W2NA== Date: Wed, 30 Jul 2014 06:12:27 +0000 Message-ID: <6AA21C22F0A5DA478922644AD2EC308C897ED0@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Ma Jianpeng --- src/osd/ECBackend.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/osd/ECBackend.h b/src/osd/ECBackend.h index 28bcf8a..0e96407 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()); } /**