diff options
Diffstat (limited to 'fs/ceph/addr.c')
-rw-r--r-- | fs/ceph/addr.c | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index fc613715af46..cfef3e01a9b3 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
@@ -236,16 +236,10 @@ static int ceph_readpage(struct file *filp, struct page *page) | |||
236 | static void finish_read(struct ceph_osd_request *req, struct ceph_msg *msg) | 236 | static void finish_read(struct ceph_osd_request *req, struct ceph_msg *msg) |
237 | { | 237 | { |
238 | struct inode *inode = req->r_inode; | 238 | struct inode *inode = req->r_inode; |
239 | struct ceph_osd_reply_head *replyhead; | 239 | int rc = req->r_result; |
240 | int rc, bytes; | 240 | int bytes = le32_to_cpu(msg->hdr.data_len); |
241 | int i; | 241 | int i; |
242 | 242 | ||
243 | /* parse reply */ | ||
244 | replyhead = msg->front.iov_base; | ||
245 | WARN_ON(le32_to_cpu(replyhead->num_ops) == 0); | ||
246 | rc = le32_to_cpu(replyhead->result); | ||
247 | bytes = le32_to_cpu(msg->hdr.data_len); | ||
248 | |||
249 | dout("finish_read %p req %p rc %d bytes %d\n", inode, req, rc, bytes); | 243 | dout("finish_read %p req %p rc %d bytes %d\n", inode, req, rc, bytes); |
250 | 244 | ||
251 | /* unlock all pages, zeroing any data we didn't read */ | 245 | /* unlock all pages, zeroing any data we didn't read */ |
@@ -553,27 +547,18 @@ static void writepages_finish(struct ceph_osd_request *req, | |||
553 | struct ceph_msg *msg) | 547 | struct ceph_msg *msg) |
554 | { | 548 | { |
555 | struct inode *inode = req->r_inode; | 549 | struct inode *inode = req->r_inode; |
556 | struct ceph_osd_reply_head *replyhead; | ||
557 | struct ceph_osd_op *op; | ||
558 | struct ceph_inode_info *ci = ceph_inode(inode); | 550 | struct ceph_inode_info *ci = ceph_inode(inode); |
559 | unsigned wrote; | 551 | unsigned wrote; |
560 | struct page *page; | 552 | struct page *page; |
561 | int i; | 553 | int i; |
562 | struct ceph_snap_context *snapc = req->r_snapc; | 554 | struct ceph_snap_context *snapc = req->r_snapc; |
563 | struct address_space *mapping = inode->i_mapping; | 555 | struct address_space *mapping = inode->i_mapping; |
564 | __s32 rc = -EIO; | 556 | int rc = req->r_result; |
565 | u64 bytes = 0; | 557 | u64 bytes = le64_to_cpu(req->r_request_ops[0].extent.length); |
566 | struct ceph_fs_client *fsc = ceph_inode_to_client(inode); | 558 | struct ceph_fs_client *fsc = ceph_inode_to_client(inode); |
567 | long writeback_stat; | 559 | long writeback_stat; |
568 | unsigned issued = ceph_caps_issued(ci); | 560 | unsigned issued = ceph_caps_issued(ci); |
569 | 561 | ||
570 | /* parse reply */ | ||
571 | replyhead = msg->front.iov_base; | ||
572 | WARN_ON(le32_to_cpu(replyhead->num_ops) == 0); | ||
573 | op = (void *)(replyhead + 1); | ||
574 | rc = le32_to_cpu(replyhead->result); | ||
575 | bytes = le64_to_cpu(op->extent.length); | ||
576 | |||
577 | if (rc >= 0) { | 562 | if (rc >= 0) { |
578 | /* | 563 | /* |
579 | * Assume we wrote the pages we originally sent. The | 564 | * Assume we wrote the pages we originally sent. The |
@@ -740,8 +725,6 @@ retry: | |||
740 | struct page *page; | 725 | struct page *page; |
741 | int want; | 726 | int want; |
742 | u64 offset, len; | 727 | u64 offset, len; |
743 | struct ceph_osd_request_head *reqhead; | ||
744 | struct ceph_osd_op *op; | ||
745 | long writeback_stat; | 728 | long writeback_stat; |
746 | 729 | ||
747 | next = 0; | 730 | next = 0; |
@@ -905,10 +888,8 @@ get_more_pages: | |||
905 | 888 | ||
906 | /* revise final length, page count */ | 889 | /* revise final length, page count */ |
907 | req->r_num_pages = locked_pages; | 890 | req->r_num_pages = locked_pages; |
908 | reqhead = req->r_request->front.iov_base; | 891 | req->r_request_ops[0].extent.length = cpu_to_le64(len); |
909 | op = (void *)(reqhead + 1); | 892 | req->r_request_ops[0].payload_len = cpu_to_le32(len); |
910 | op->extent.length = cpu_to_le64(len); | ||
911 | op->payload_len = cpu_to_le32(len); | ||
912 | req->r_request->hdr.data_len = cpu_to_le32(len); | 893 | req->r_request->hdr.data_len = cpu_to_le32(len); |
913 | 894 | ||
914 | rc = ceph_osdc_start_request(&fsc->client->osdc, req, true); | 895 | rc = ceph_osdc_start_request(&fsc->client->osdc, req, true); |