aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/osd_client.c
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-02-23 13:38:16 -0500
committerSage Weil <sage@inktank.com>2013-02-26 18:01:57 -0500
commit5b191d9914eb68257f47de9d5bfe099b77f0687c (patch)
tree2465631736897b02dd16de136ef5b69dadb943f1 /net/ceph/osd_client.c
parent12979354a1d6ef25d86f381e4d5f9e103f29913a (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 'net/ceph/osd_client.c')
-rw-r--r--net/ceph/osd_client.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index e3ab8d60d080..1990834e518b 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -914,7 +914,7 @@ static int __map_request(struct ceph_osd_client *osdc,
914 struct ceph_osd_request *req, int force_resend) 914 struct ceph_osd_request *req, int force_resend)
915{ 915{
916 struct ceph_osd_request_head *reqhead = req->r_request->front.iov_base; 916 struct ceph_osd_request_head *reqhead = req->r_request->front.iov_base;
917 struct ceph_pg_v1 pgid; 917 struct ceph_pg pgid;
918 int acting[CEPH_PG_MAX_SIZE]; 918 int acting[CEPH_PG_MAX_SIZE];
919 int o = -1, num = 0; 919 int o = -1, num = 0;
920 int err; 920 int err;
@@ -926,7 +926,8 @@ static int __map_request(struct ceph_osd_client *osdc,
926 list_move(&req->r_req_lru_item, &osdc->req_notarget); 926 list_move(&req->r_req_lru_item, &osdc->req_notarget);
927 return err; 927 return err;
928 } 928 }
929 pgid = reqhead->layout.ol_pgid; 929 pgid.pool = le32_to_cpu(reqhead->layout.ol_pgid.pool);
930 pgid.seed = le16_to_cpu(reqhead->layout.ol_pgid.ps);
930 req->r_pgid = pgid; 931 req->r_pgid = pgid;
931 932
932 err = ceph_calc_pg_acting(osdc->osdmap, pgid, acting); 933 err = ceph_calc_pg_acting(osdc->osdmap, pgid, acting);
@@ -943,8 +944,8 @@ static int __map_request(struct ceph_osd_client *osdc,
943 (req->r_osd == NULL && o == -1)) 944 (req->r_osd == NULL && o == -1))
944 return 0; /* no change */ 945 return 0; /* no change */
945 946
946 dout("map_request tid %llu pgid %d.%x osd%d (was osd%d)\n", 947 dout("map_request tid %llu pgid %lld.%x osd%d (was osd%d)\n",
947 req->r_tid, le32_to_cpu(pgid.pool), le16_to_cpu(pgid.ps), o, 948 req->r_tid, pgid.pool, pgid.seed, o,
948 req->r_osd ? req->r_osd->o_osd : -1); 949 req->r_osd ? req->r_osd->o_osd : -1);
949 950
950 /* record full pg acting set */ 951 /* record full pg acting set */