Skip to content

Commit 2abebdb

Browse files
idryomovSage Weil
authored andcommitted
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>
1 parent 246138f commit 2abebdb

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

‎include/linux/ceph/osdmap.h‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ struct ceph_pg_pool_info {
4141
char *name;
4242
};
4343

44+
static 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+
4456
struct ceph_object_locator {
4557
s64 pool;
4658
};

‎include/linux/ceph/rados.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ struct ceph_pg_v1 {
8181
*/
8282
#define CEPH_NOPOOL ((__u64) (-1)) /* pool id not defined */
8383

84-
#define CEPH_PG_TYPE_REP 1
85-
#define CEPH_PG_TYPE_RAID4 2
84+
#define CEPH_POOL_TYPE_REP 1
85+
#define CEPH_POOL_TYPE_RAID4 2 /* never implemented */
86+
#define CEPH_POOL_TYPE_EC 3
8687

8788
/*
8889
* stable_mod func is used to control number of placement groups.

0 commit comments

Comments
 (0)