summaryrefslogtreecommitdiffstats
path: root/fs/ceph/osd_client.c
diff options
context:
space:
mode:
authorSage Weil2009-11-04 20:39:12 +0100
committerSage Weil2009-11-05 01:36:07 +0100
commit51042122d4f85e0f8ee577a4230f172fcc57c456 (patch)
treed5ccf5f84d362b6542a86eab6b6f50112111434b /fs/ceph/osd_client.c
parentceph: use fixed endian encoding for ceph_entity_addr (diff)
downloadkernel-qcow2-linux-51042122d4f85e0f8ee577a4230f172fcc57c456.tar.gz
kernel-qcow2-linux-51042122d4f85e0f8ee577a4230f172fcc57c456.tar.xz
kernel-qcow2-linux-51042122d4f85e0f8ee577a4230f172fcc57c456.zip
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>
Diffstat (limited to 'fs/ceph/osd_client.c')
-rw-r--r--fs/ceph/osd_client.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ceph/osd_client.c b/fs/ceph/osd_client.c
index 7dc0f6299a52..7db14ba6261c 100644
--- a/fs/ceph/osd_client.c
+++ b/fs/ceph/osd_client.c
@@ -520,7 +520,7 @@ static int __map_osds(struct ceph_osd_client *osdc,
struct ceph_osd_request *req)
{
struct ceph_osd_request_head *reqhead = req->r_request->front.iov_base;
- union ceph_pg pgid;
+ struct ceph_pg pgid;
int o = -1;
int err;
struct ceph_osd *newosd = NULL;
@@ -530,7 +530,7 @@ static int __map_osds(struct ceph_osd_client *osdc,
&req->r_file_layout, osdc->osdmap);
if (err)
return err;
- pgid.pg64 = le64_to_cpu(reqhead->layout.ol_pgid);
+ pgid = reqhead->layout.ol_pgid;
o = ceph_calc_pg_primary(osdc->osdmap, pgid);
if ((req->r_osd && req->r_osd->o_osd == o &&
@@ -538,8 +538,8 @@ static int __map_osds(struct ceph_osd_client *osdc,
(req->r_osd == NULL && o == -1))
return 0; /* no change */
- dout("map_osds tid %llu pgid %llx pool %d osd%d (was osd%d)\n",
- req->r_tid, pgid.pg64, pgid.pg.pool, o,
+ dout("map_osds tid %llu pgid %d.%x osd%d (was osd%d)\n",
+ req->r_tid, le32_to_cpu(pgid.pool), le16_to_cpu(pgid.ps), o,
req->r_osd ? req->r_osd->o_osd : -1);
if (req->r_osd) {