aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/osdmap.c
diff options
context:
space:
mode:
authorIlya Dryomov <ilya.dryomov@inktank.com>2014-03-21 13:05:29 -0400
committerSage Weil <sage@inktank.com>2014-04-05 00:07:57 -0400
commit35a935d75d51abe58d3427a8b4ae3745a5a14e1c (patch)
tree0ad881fa4d6c3417e10d07cd6423751cf68e6a1f /net/ceph/osdmap.c
parentec7af97258396161e6effba7e788c3fc3cb55263 (diff)
libceph: generalize ceph_pg_mapping
In preparation for adding support for primary_temp mappings, generalize struct ceph_pg_mapping so it can hold mappings other than pg_temp. Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org>
Diffstat (limited to 'net/ceph/osdmap.c')
-rw-r--r--net/ceph/osdmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c
index be2a65fbd902..c67a309fdfc2 100644
--- a/net/ceph/osdmap.c
+++ b/net/ceph/osdmap.c
@@ -822,9 +822,9 @@ static int __decode_pg_temp(void **p, void *end, struct ceph_osdmap *map,
822 return -ENOMEM; 822 return -ENOMEM;
823 823
824 pg->pgid = pgid; 824 pg->pgid = pgid;
825 pg->len = len; 825 pg->pg_temp.len = len;
826 for (i = 0; i < len; i++) 826 for (i = 0; i < len; i++)
827 pg->osds[i] = ceph_decode_32(p); 827 pg->pg_temp.osds[i] = ceph_decode_32(p);
828 828
829 ret = __insert_pg_mapping(pg, &map->pg_temp); 829 ret = __insert_pg_mapping(pg, &map->pg_temp);
830 if (ret) { 830 if (ret) {
@@ -1281,8 +1281,8 @@ static int *calc_pg_raw(struct ceph_osdmap *osdmap, struct ceph_pg pgid,
1281 pool->pg_num_mask); 1281 pool->pg_num_mask);
1282 pg = __lookup_pg_mapping(&osdmap->pg_temp, pgid); 1282 pg = __lookup_pg_mapping(&osdmap->pg_temp, pgid);
1283 if (pg) { 1283 if (pg) {
1284 *num = pg->len; 1284 *num = pg->pg_temp.len;
1285 return pg->osds; 1285 return pg->pg_temp.osds;
1286 } 1286 }
1287 1287
1288 /* crush */ 1288 /* crush */