aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ceph
diff options
context:
space:
mode:
authorIlya Dryomov <ilya.dryomov@inktank.com>2014-03-24 11:12:47 -0400
committerSage Weil <sage@inktank.com>2014-04-05 00:08:08 -0400
commit2abebdbca7997422bfab6bf8b6559384a6b95294 (patch)
tree27b6168487c4308843f453f58eb00923271fa004 /include/linux/ceph
parent246138fa6787db6f4016f26604fdc05dc9f95627 (diff)
libceph: ceph_can_shift_osds(pool) and pool type defines
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>
Diffstat (limited to 'include/linux/ceph')
-rw-r--r--include/linux/ceph/osdmap.h12
-rw-r--r--include/linux/ceph/rados.h5
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 {
41 char *name; 41 char *name;
42}; 42};
43 43
44static inline bool ceph_can_shift_osds(struct ceph_pg_pool_info *pool)
45{
46 switch (pool->type) {
47 case CEPH_POOL_TYPE_REP:
48 return true;
49 case CEPH_POOL_TYPE_EC:
50 return false;
51 default:
52 BUG_ON(1);
53 }
54}
55
44struct ceph_object_locator { 56struct ceph_object_locator {
45 s64 pool; 57 s64 pool;
46}; 58};
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 {
81 */ 81 */
82#define CEPH_NOPOOL ((__u64) (-1)) /* pool id not defined */ 82#define CEPH_NOPOOL ((__u64) (-1)) /* pool id not defined */
83 83
84#define CEPH_PG_TYPE_REP 1 84#define CEPH_POOL_TYPE_REP 1
85#define CEPH_PG_TYPE_RAID4 2 85#define CEPH_POOL_TYPE_RAID4 2 /* never implemented */
86#define CEPH_POOL_TYPE_EC 3
86 87
87/* 88/*
88 * stable_mod func is used to control number of placement groups. 89 * stable_mod func is used to control number of placement groups.