ceph: fix endian conversions for ceph_pg
The endian conversions don't quite work with the old union ceph_pg. Just make it a regular struct, and make each field __le. This is simpler and it has the added bonus of actually working. Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
@@ -99,7 +99,7 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg)
|
||||
u64 len = 1, olen;
|
||||
u64 tmp;
|
||||
struct ceph_object_layout ol;
|
||||
union ceph_pg pgid;
|
||||
struct ceph_pg pgid;
|
||||
|
||||
/* copy and validate */
|
||||
if (copy_from_user(&dl, arg, sizeof(dl)))
|
||||
@@ -121,7 +121,7 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg)
|
||||
ceph_calc_object_layout(&ol, dl.object_name, &ci->i_layout,
|
||||
osdc->osdmap);
|
||||
|
||||
pgid.pg64 = le64_to_cpu(ol.ol_pgid);
|
||||
pgid = ol.ol_pgid;
|
||||
dl.osd = ceph_calc_pg_primary(osdc->osdmap, pgid);
|
||||
if (dl.osd >= 0) {
|
||||
struct ceph_entity_addr *a =
|
||||
|
Reference in New Issue
Block a user