libceph: ceph_can_shift_osds(pool) and pool type defines
authorIlya Dryomov <ilya.dryomov@inktank.com>
Mon, 24 Mar 2014 15:12:47 +0000 (17:12 +0200)
committerSage Weil <sage@inktank.com>
Sat, 5 Apr 2014 04:08:08 +0000 (21:08 -0700)
Bring in pg_pool_t::can_shift_osds() counterpart along with pool type
defines.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
include/linux/ceph/osdmap.h
include/linux/ceph/rados.h

index 0895797b9e28dd48cd7440f2eaaa71e3805e6edc..4e28c1e5d62fde1cb09b72a9b9586004260d5efe 100644 (file)
@@ -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;
 };
index bb6f40c9cb0fd151d3593a3826263a68b293b584..f20e0d8a2155dc0f5d95ee248c2ed1aa56af1df1 100644 (file)
@@ -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.