From patchwork Thu Mar 27 18:18:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 3899421 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 F35BABF540 for ; Thu, 27 Mar 2014 18:20:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 031B220253 for ; Thu, 27 Mar 2014 18:20:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EEC6820225 for ; Thu, 27 Mar 2014 18:20:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756829AbaC0SU1 (ORCPT ); Thu, 27 Mar 2014 14:20:27 -0400 Received: from mail-ee0-f48.google.com ([74.125.83.48]:40211 "EHLO mail-ee0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757157AbaC0STW (ORCPT ); Thu, 27 Mar 2014 14:19:22 -0400 Received: by mail-ee0-f48.google.com with SMTP id b57so3191520eek.7 for ; Thu, 27 Mar 2014 11:19:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=+GKuIFk5OIvcfiaLegwANMfhivyC1eqsBxK7YVb0D8Y=; b=HpioQo9tvZzd6nGpVA2F65KBFpVC+QyaI/o3dxWOudgGwdBpap0ltnxjN4xbFU6I+z YT827Tc3fKL6vY90Ym+bzU08cWtWo0PVVi6FavvKGJNEirlvdB2ivJ3I487BINxCPOBg FvFUAcDbteJF7tTaQLQKUD3OnsLH3RwPoBNB1z5qYXIol7WnUmiJ4ktUmMbA7ravipPz T0vddtSd3dJ5lpTE4a9XHIwfSSU4l4+ws60EDLXuu3NEEf7W09URjaYKP2+fDdd7O12a WFDk5WvHcu1uY9QmLLN5avpKzbyBjCQIBxdCjyig8GVfzShCfrC46aiFtj39zsHwVg7B rWuQ== X-Gm-Message-State: ALoCoQkWwDzwyHEroyEX3RfOpgrcF/9CE5XJhOwT9eHDV7TP2Uk9IWj95WTgHhLCKcoGzujVdDo/ X-Received: by 10.14.225.73 with SMTP id y49mr3059400eep.43.1395944361812; Thu, 27 Mar 2014 11:19:21 -0700 (PDT) Received: from localhost ([109.110.66.7]) by mx.google.com with ESMTPSA id o4sm5973134eef.20.2014.03.27.11.19.20 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 27 Mar 2014 11:19:21 -0700 (PDT) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Subject: [PATCH 25/33] libceph: ceph_can_shift_osds(pool) and pool type defines Date: Thu, 27 Mar 2014 20:18:11 +0200 Message-Id: <1395944299-21970-26-git-send-email-ilya.dryomov@inktank.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395944299-21970-1-git-send-email-ilya.dryomov@inktank.com> References: <1395944299-21970-1-git-send-email-ilya.dryomov@inktank.com> 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.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Bring in pg_pool_t::can_shift_osds() counterpart along with pool type defines. Signed-off-by: Ilya Dryomov Reviewed-by: Alex Elder --- include/linux/ceph/osdmap.h | 12 ++++++++++++ include/linux/ceph/rados.h | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h index 0895797b9e28..4e28c1e5d62f 100644 --- a/include/linux/ceph/osdmap.h +++ b/include/linux/ceph/osdmap.h @@ -41,6 +41,18 @@ struct ceph_pg_pool_info { char *name; }; +static inline bool ceph_can_shift_osds(struct ceph_pg_pool_info *pool) +{ + switch (pool->type) { + case CEPH_POOL_TYPE_REP: + return true; + case CEPH_POOL_TYPE_EC: + return false; + default: + BUG_ON(1); + } +} + struct ceph_object_locator { s64 pool; }; diff --git a/include/linux/ceph/rados.h b/include/linux/ceph/rados.h index bb6f40c9cb0f..f20e0d8a2155 100644 --- a/include/linux/ceph/rados.h +++ b/include/linux/ceph/rados.h @@ -81,8 +81,9 @@ struct ceph_pg_v1 { */ #define CEPH_NOPOOL ((__u64) (-1)) /* pool id not defined */ -#define CEPH_PG_TYPE_REP 1 -#define CEPH_PG_TYPE_RAID4 2 +#define CEPH_POOL_TYPE_REP 1 +#define CEPH_POOL_TYPE_RAID4 2 /* never implemented */ +#define CEPH_POOL_TYPE_EC 3 /* * stable_mod func is used to control number of placement groups.