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 /fs/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 'fs/ceph')
-rw-r--r-- | fs/ceph/ioctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index e831436d6e68..fb036ed3e129 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c | |||
@@ -186,7 +186,7 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) | |||
186 | u64 len = 1, olen; | 186 | u64 len = 1, olen; |
187 | u64 tmp; | 187 | u64 tmp; |
188 | struct ceph_object_layout ol; | 188 | struct ceph_object_layout ol; |
189 | struct ceph_pg_v1 pgid; | 189 | struct ceph_pg pgid; |
190 | int r; | 190 | int r; |
191 | 191 | ||
192 | /* copy and validate */ | 192 | /* copy and validate */ |
@@ -212,7 +212,8 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) | |||
212 | ceph_calc_object_layout(&ol, dl.object_name, &ci->i_layout, | 212 | ceph_calc_object_layout(&ol, dl.object_name, &ci->i_layout, |
213 | osdc->osdmap); | 213 | osdc->osdmap); |
214 | 214 | ||
215 | pgid = ol.ol_pgid; | 215 | pgid.pool = le32_to_cpu(ol.ol_pgid.pool); |
216 | pgid.seed = le16_to_cpu(ol.ol_pgid.ps); | ||
216 | dl.osd = ceph_calc_pg_primary(osdc->osdmap, pgid); | 217 | dl.osd = ceph_calc_pg_primary(osdc->osdmap, pgid); |
217 | if (dl.osd >= 0) { | 218 | if (dl.osd >= 0) { |
218 | struct ceph_entity_addr *a = | 219 | struct ceph_entity_addr *a = |