aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/ceph/osdmap.h9
-rw-r--r--net/ceph/debugfs.c4
-rw-r--r--net/ceph/osdmap.c8
3 files changed, 13 insertions, 8 deletions
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h
index 46c3e304c3d8..4837e58e3203 100644
--- a/include/linux/ceph/osdmap.h
+++ b/include/linux/ceph/osdmap.h
@@ -60,8 +60,13 @@ struct ceph_object_id {
60struct ceph_pg_mapping { 60struct ceph_pg_mapping {
61 struct rb_node node; 61 struct rb_node node;
62 struct ceph_pg pgid; 62 struct ceph_pg pgid;
63 int len; 63
64 int osds[]; 64 union {
65 struct {
66 int len;
67 int osds[];
68 } pg_temp;
69 };
65}; 70};
66 71
67struct ceph_osdmap { 72struct ceph_osdmap {
diff --git a/net/ceph/debugfs.c b/net/ceph/debugfs.c
index c45d235e774e..5865f2c9580a 100644
--- a/net/ceph/debugfs.c
+++ b/net/ceph/debugfs.c
@@ -88,9 +88,9 @@ static int osdmap_show(struct seq_file *s, void *p)
88 88
89 seq_printf(s, "pg_temp %llu.%x [", pg->pgid.pool, 89 seq_printf(s, "pg_temp %llu.%x [", pg->pgid.pool,
90 pg->pgid.seed); 90 pg->pgid.seed);
91 for (i = 0; i < pg->len; i++) 91 for (i = 0; i < pg->pg_temp.len; i++)
92 seq_printf(s, "%s%d", (i == 0 ? "" : ","), 92 seq_printf(s, "%s%d", (i == 0 ? "" : ","),
93 pg->osds[i]); 93 pg->pg_temp.osds[i]);
94 seq_printf(s, "]\n"); 94 seq_printf(s, "]\n");
95 } 95 }
96 96
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 */