diff options
-rw-r--r-- | drivers/block/rbd.c | 4 | ||||
-rw-r--r-- | include/linux/ceph/osd_client.h | 2 | ||||
-rw-r--r-- | net/ceph/osd_client.c | 14 |
3 files changed, 7 insertions, 13 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index c1b135b6cb97..fa371868e9b0 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -1169,10 +1169,10 @@ static int rbd_do_request(struct request *rq, | |||
1169 | 1169 | ||
1170 | rbd_layout_init(&osd_req->r_file_layout, rbd_dev->spec->pool_id); | 1170 | rbd_layout_init(&osd_req->r_file_layout, rbd_dev->spec->pool_id); |
1171 | ret = ceph_calc_raw_layout(osdc, &osd_req->r_file_layout, | 1171 | ret = ceph_calc_raw_layout(osdc, &osd_req->r_file_layout, |
1172 | snapid, ofs, &len, &bno, osd_req, ops); | 1172 | ofs, &len, &bno, osd_req, ops); |
1173 | rbd_assert(ret == 0); | 1173 | rbd_assert(ret == 0); |
1174 | 1174 | ||
1175 | ceph_osdc_build_request(osd_req, ofs, len, ops, snapc, &mtime); | 1175 | ceph_osdc_build_request(osd_req, ofs, len, ops, snapc, snapid, &mtime); |
1176 | 1176 | ||
1177 | if (linger_req) { | 1177 | if (linger_req) { |
1178 | ceph_osdc_set_request_linger(osdc, osd_req); | 1178 | ceph_osdc_set_request_linger(osdc, osd_req); |
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index 4bfb4582439a..0e82a0a967ef 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
@@ -209,7 +209,6 @@ extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, | |||
209 | 209 | ||
210 | extern int ceph_calc_raw_layout(struct ceph_osd_client *osdc, | 210 | extern int ceph_calc_raw_layout(struct ceph_osd_client *osdc, |
211 | struct ceph_file_layout *layout, | 211 | struct ceph_file_layout *layout, |
212 | u64 snapid, | ||
213 | u64 off, u64 *plen, u64 *bno, | 212 | u64 off, u64 *plen, u64 *bno, |
214 | struct ceph_osd_request *req, | 213 | struct ceph_osd_request *req, |
215 | struct ceph_osd_req_op *op); | 214 | struct ceph_osd_req_op *op); |
@@ -227,6 +226,7 @@ extern void ceph_osdc_build_request(struct ceph_osd_request *req, | |||
227 | u64 off, u64 len, | 226 | u64 off, u64 len, |
228 | struct ceph_osd_req_op *src_ops, | 227 | struct ceph_osd_req_op *src_ops, |
229 | struct ceph_snap_context *snapc, | 228 | struct ceph_snap_context *snapc, |
229 | u64 snap_id, | ||
230 | struct timespec *mtime); | 230 | struct timespec *mtime); |
231 | 231 | ||
232 | extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, | 232 | extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, |
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 47e5f5b1f94c..b5a4b2875e8a 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -40,18 +40,14 @@ static int op_has_extent(int op) | |||
40 | 40 | ||
41 | int ceph_calc_raw_layout(struct ceph_osd_client *osdc, | 41 | int ceph_calc_raw_layout(struct ceph_osd_client *osdc, |
42 | struct ceph_file_layout *layout, | 42 | struct ceph_file_layout *layout, |
43 | u64 snapid, | ||
44 | u64 off, u64 *plen, u64 *bno, | 43 | u64 off, u64 *plen, u64 *bno, |
45 | struct ceph_osd_request *req, | 44 | struct ceph_osd_request *req, |
46 | struct ceph_osd_req_op *op) | 45 | struct ceph_osd_req_op *op) |
47 | { | 46 | { |
48 | struct ceph_osd_request_head *reqhead = req->r_request->front.iov_base; | ||
49 | u64 orig_len = *plen; | 47 | u64 orig_len = *plen; |
50 | u64 objoff, objlen; /* extent in object */ | 48 | u64 objoff, objlen; /* extent in object */ |
51 | int r; | 49 | int r; |
52 | 50 | ||
53 | reqhead->snapid = cpu_to_le64(snapid); | ||
54 | |||
55 | /* object extent? */ | 51 | /* object extent? */ |
56 | r = ceph_calc_file_object_mapping(layout, off, orig_len, bno, | 52 | r = ceph_calc_file_object_mapping(layout, off, orig_len, bno, |
57 | &objoff, &objlen); | 53 | &objoff, &objlen); |
@@ -121,8 +117,7 @@ static int calc_layout(struct ceph_osd_client *osdc, | |||
121 | u64 bno; | 117 | u64 bno; |
122 | int r; | 118 | int r; |
123 | 119 | ||
124 | r = ceph_calc_raw_layout(osdc, layout, vino.snap, off, | 120 | r = ceph_calc_raw_layout(osdc, layout, off, plen, &bno, req, op); |
125 | plen, &bno, req, op); | ||
126 | if (r < 0) | 121 | if (r < 0) |
127 | return r; | 122 | return r; |
128 | 123 | ||
@@ -340,7 +335,7 @@ static void osd_req_encode_op(struct ceph_osd_request *req, | |||
340 | void ceph_osdc_build_request(struct ceph_osd_request *req, | 335 | void ceph_osdc_build_request(struct ceph_osd_request *req, |
341 | u64 off, u64 len, | 336 | u64 off, u64 len, |
342 | struct ceph_osd_req_op *src_ops, | 337 | struct ceph_osd_req_op *src_ops, |
343 | struct ceph_snap_context *snapc, | 338 | struct ceph_snap_context *snapc, u64 snap_id, |
344 | struct timespec *mtime) | 339 | struct timespec *mtime) |
345 | { | 340 | { |
346 | struct ceph_msg *msg = req->r_request; | 341 | struct ceph_msg *msg = req->r_request; |
@@ -355,6 +350,7 @@ void ceph_osdc_build_request(struct ceph_osd_request *req, | |||
355 | int i; | 350 | int i; |
356 | 351 | ||
357 | head = msg->front.iov_base; | 352 | head = msg->front.iov_base; |
353 | head->snapid = cpu_to_le64(snap_id); | ||
358 | op = (void *)(head + 1); | 354 | op = (void *)(head + 1); |
359 | p = (void *)(op + num_op); | 355 | p = (void *)(op + num_op); |
360 | 356 | ||
@@ -466,9 +462,7 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, | |||
466 | req->r_num_pages = calc_pages_for(page_align, *plen); | 462 | req->r_num_pages = calc_pages_for(page_align, *plen); |
467 | req->r_page_alignment = page_align; | 463 | req->r_page_alignment = page_align; |
468 | 464 | ||
469 | ceph_osdc_build_request(req, off, *plen, ops, | 465 | ceph_osdc_build_request(req, off, *plen, ops, snapc, vino.snap, mtime); |
470 | snapc, | ||
471 | mtime); | ||
472 | 466 | ||
473 | return req; | 467 | return req; |
474 | } | 468 | } |