diff options
| author | Sage Weil <sage@inktank.com> | 2013-02-23 13:38:16 -0500 |
|---|---|---|
| committer | Sage Weil <sage@inktank.com> | 2013-02-26 18:01:57 -0500 |
| commit | 5b191d9914eb68257f47de9d5bfe099b77f0687c (patch) | |
| tree | 2465631736897b02dd16de136ef5b69dadb943f1 /include/linux/ceph | |
| parent | 12979354a1d6ef25d86f381e4d5f9e103f29913a (diff) | |
libceph: decode into cpu-native ceph_pg type
Always decode data into our cpu-native ceph_pg type that has the correct
field widths. Limit any remaining uses of ceph_pg_v1 to dealing with the
legacy protocol.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Alex Elder <elder@inktank.com>
Diffstat (limited to 'include/linux/ceph')
| -rw-r--r-- | include/linux/ceph/osd_client.h | 2 | ||||
| -rw-r--r-- | include/linux/ceph/osdmap.h | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index be2867330e23..388158ff0cbc 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
| @@ -56,7 +56,7 @@ struct ceph_osd_request { | |||
| 56 | struct list_head r_linger_item; | 56 | struct list_head r_linger_item; |
| 57 | struct list_head r_linger_osd; | 57 | struct list_head r_linger_osd; |
| 58 | struct ceph_osd *r_osd; | 58 | struct ceph_osd *r_osd; |
| 59 | struct ceph_pg_v1 r_pgid; | 59 | struct ceph_pg r_pgid; |
| 60 | int r_pg_osds[CEPH_PG_MAX_SIZE]; | 60 | int r_pg_osds[CEPH_PG_MAX_SIZE]; |
| 61 | int r_num_pg_osds; | 61 | int r_num_pg_osds; |
| 62 | 62 | ||
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h index eb4989aa48e8..8a612df4c248 100644 --- a/include/linux/ceph/osdmap.h +++ b/include/linux/ceph/osdmap.h | |||
| @@ -18,6 +18,11 @@ | |||
| 18 | * The map can be updated either via an incremental map (diff) describing | 18 | * The map can be updated either via an incremental map (diff) describing |
| 19 | * the change between two successive epochs, or as a fully encoded map. | 19 | * the change between two successive epochs, or as a fully encoded map. |
| 20 | */ | 20 | */ |
| 21 | struct ceph_pg { | ||
| 22 | uint64_t pool; | ||
| 23 | uint32_t seed; | ||
| 24 | }; | ||
| 25 | |||
| 21 | struct ceph_pg_pool_info { | 26 | struct ceph_pg_pool_info { |
| 22 | struct rb_node node; | 27 | struct rb_node node; |
| 23 | int id; | 28 | int id; |
| @@ -28,7 +33,7 @@ struct ceph_pg_pool_info { | |||
| 28 | 33 | ||
| 29 | struct ceph_pg_mapping { | 34 | struct ceph_pg_mapping { |
| 30 | struct rb_node node; | 35 | struct rb_node node; |
| 31 | struct ceph_pg_v1 pgid; | 36 | struct ceph_pg pgid; |
| 32 | int len; | 37 | int len; |
| 33 | int osds[]; | 38 | int osds[]; |
| 34 | }; | 39 | }; |
| @@ -119,10 +124,10 @@ extern int ceph_calc_object_layout(struct ceph_object_layout *ol, | |||
| 119 | struct ceph_file_layout *fl, | 124 | struct ceph_file_layout *fl, |
| 120 | struct ceph_osdmap *osdmap); | 125 | struct ceph_osdmap *osdmap); |
| 121 | extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap, | 126 | extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap, |
| 122 | struct ceph_pg_v1 pgid, | 127 | struct ceph_pg pgid, |
| 123 | int *acting); | 128 | int *acting); |
| 124 | extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap, | 129 | extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap, |
| 125 | struct ceph_pg_v1 pgid); | 130 | struct ceph_pg pgid); |
| 126 | 131 | ||
| 127 | extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id); | 132 | extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id); |
| 128 | extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name); | 133 | extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name); |
