diff mbox

[25/33] libceph: ceph_can_shift_osds(pool) and pool type defines

Message ID 1395944299-21970-26-git-send-email-ilya.dryomov@inktank.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ilya Dryomov March 27, 2014, 6:18 p.m. UTC
Bring in pg_pool_t::can_shift_osds() counterpart along with pool type
defines.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
---
 include/linux/ceph/osdmap.h |   12 ++++++++++++
 include/linux/ceph/rados.h  |    5 +++--
 2 files changed, 15 insertions(+), 2 deletions(-)

Comments

Alex Elder March 27, 2014, 8:34 p.m. UTC | #1
On 03/27/2014 01:18 PM, Ilya Dryomov wrote:
> Bring in pg_pool_t::can_shift_osds() counterpart along with pool type
> defines.

Looks good.

Reviewed-by: Alex Elder <elder@linaro.org>

> Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
> ---
>  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.
> 

--
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 mbox

Patch

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.