aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
Diffstat (limited to 'net/ceph')
-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 bbd157592c6c..b58748ec405d 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -335,7 +335,7 @@ void ceph_osdc_build_request(struct ceph_osd_request *req,
335 void *p; 335 void *p;
336 size_t msg_size = sizeof(*head) + num_op*sizeof(*op); 336 size_t msg_size = sizeof(*head) + num_op*sizeof(*op);
337 int flags = req->r_flags; 337 int flags = req->r_flags;
338 u64 data_len = 0; 338 u64 data_len;
339 int i; 339 int i;
340 340
341 WARN_ON((flags & (CEPH_OSD_FLAG_READ|CEPH_OSD_FLAG_WRITE)) == 0); 341 WARN_ON((flags & (CEPH_OSD_FLAG_READ|CEPH_OSD_FLAG_WRITE)) == 0);
@@ -363,8 +363,6 @@ void ceph_osdc_build_request(struct ceph_osd_request *req,
363 while (num_op--) 363 while (num_op--)
364 osd_req_encode_op(req, op++, src_op++); 364 osd_req_encode_op(req, op++, src_op++);
365 365
366 data_len += req->r_trail.length;
367
368 if (snapc) { 366 if (snapc) {
369 head->snap_seq = cpu_to_le64(snapc->seq); 367 head->snap_seq = cpu_to_le64(snapc->seq);
370 head->num_snaps = cpu_to_le32(snapc->num_snaps); 368 head->num_snaps = cpu_to_le32(snapc->num_snaps);
@@ -374,14 +372,12 @@ void ceph_osdc_build_request(struct ceph_osd_request *req,
374 } 372 }
375 } 373 }
376 374
375 data_len = req->r_trail.length;
377 if (flags & CEPH_OSD_FLAG_WRITE) { 376 if (flags & CEPH_OSD_FLAG_WRITE) {
378 req->r_request->hdr.data_off = cpu_to_le16(off); 377 req->r_request->hdr.data_off = cpu_to_le16(off);
379 req->r_request->hdr.data_len = cpu_to_le32(len + data_len); 378 data_len += len;
380 } else if (data_len) {
381 req->r_request->hdr.data_off = 0;
382 req->r_request->hdr.data_len = cpu_to_le32(data_len);
383 } 379 }
384 380 req->r_request->hdr.data_len = cpu_to_le32(data_len);
385 req->r_request->page_alignment = req->r_page_alignment; 381 req->r_request->page_alignment = req->r_page_alignment;
386 382
387 BUG_ON(p > msg->front.iov_base + msg->front.iov_len); 383 BUG_ON(p > msg->front.iov_base + msg->front.iov_len);