aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ceph/osd_client.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index df72234e66e4..29e4fe09e31a 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -64,7 +64,6 @@ static int op_has_extent(int op)
64 * fill osd op in request message. 64 * fill osd op in request message.
65 */ 65 */
66static int calc_layout(struct ceph_file_layout *layout, u64 off, u64 *plen, 66static int calc_layout(struct ceph_file_layout *layout, u64 off, u64 *plen,
67 struct ceph_osd_request *req,
68 struct ceph_osd_req_op *op, u64 *bno) 67 struct ceph_osd_req_op *op, u64 *bno)
69{ 68{
70 u64 orig_len = *plen; 69 u64 orig_len = *plen;
@@ -95,13 +94,10 @@ static int calc_layout(struct ceph_file_layout *layout, u64 off, u64 *plen,
95 op->extent.truncate_size = osize; 94 op->extent.truncate_size = osize;
96 } 95 }
97 } 96 }
98 req->r_num_pages = calc_pages_for(off, *plen);
99 req->r_page_alignment = off & ~PAGE_MASK;
100 if (op->op == CEPH_OSD_OP_WRITE) 97 if (op->op == CEPH_OSD_OP_WRITE)
101 op->payload_len = *plen; 98 op->payload_len = *plen;
102 99
103 dout("calc_layout bno=%llx %llu~%llu (%d pages)\n", 100 dout("calc_layout bno=%llx %llu~%llu\n", *bno, objoff, objlen);
104 *bno, objoff, objlen, req->r_num_pages);
105 101
106 return 0; 102 return 0;
107} 103}
@@ -464,7 +460,7 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
464 req->r_flags = flags; 460 req->r_flags = flags;
465 461
466 /* calculate max write size */ 462 /* calculate max write size */
467 r = calc_layout(layout, off, plen, req, ops, &bno); 463 r = calc_layout(layout, off, plen, ops, &bno);
468 if (r < 0) { 464 if (r < 0) {
469 ceph_osdc_put_request(req); 465 ceph_osdc_put_request(req);
470 return ERR_PTR(r); 466 return ERR_PTR(r);
@@ -475,8 +471,8 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
475 snprintf(req->r_oid, sizeof(req->r_oid), "%llx.%08llx", vino.ino, bno); 471 snprintf(req->r_oid, sizeof(req->r_oid), "%llx.%08llx", vino.ino, bno);
476 req->r_oid_len = strlen(req->r_oid); 472 req->r_oid_len = strlen(req->r_oid);
477 473
478 /* in case it differs from natural (file) alignment that 474 /* The alignment may differ from the natural (file) alignment */
479 calc_layout filled in for us */ 475
480 req->r_num_pages = calc_pages_for(page_align, *plen); 476 req->r_num_pages = calc_pages_for(page_align, *plen);
481 req->r_page_alignment = page_align; 477 req->r_page_alignment = page_align;
482 478