diff options
| -rw-r--r-- | drivers/block/rbd.c | 19 | ||||
| -rw-r--r-- | fs/ceph/file.c | 10 | ||||
| -rw-r--r-- | net/ceph/osd_client.c | 38 |
3 files changed, 38 insertions, 29 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 9cc7ee3b427f..8e5140bbf241 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
| @@ -1500,9 +1500,6 @@ rbd_osd_req_create(struct rbd_obj_request *obj_req, unsigned int num_ops) | |||
| 1500 | rbd_dev->header.object_prefix, obj_req->ex.oe_objno)) | 1500 | rbd_dev->header.object_prefix, obj_req->ex.oe_objno)) |
| 1501 | goto err_req; | 1501 | goto err_req; |
| 1502 | 1502 | ||
| 1503 | if (ceph_osdc_alloc_messages(req, GFP_NOIO)) | ||
| 1504 | goto err_req; | ||
| 1505 | |||
| 1506 | return req; | 1503 | return req; |
| 1507 | 1504 | ||
| 1508 | err_req: | 1505 | err_req: |
| @@ -1945,6 +1942,10 @@ static int __rbd_img_fill_request(struct rbd_img_request *img_req) | |||
| 1945 | } | 1942 | } |
| 1946 | if (ret) | 1943 | if (ret) |
| 1947 | return ret; | 1944 | return ret; |
| 1945 | |||
| 1946 | ret = ceph_osdc_alloc_messages(obj_req->osd_req, GFP_NOIO); | ||
| 1947 | if (ret) | ||
| 1948 | return ret; | ||
| 1948 | } | 1949 | } |
| 1949 | 1950 | ||
| 1950 | return 0; | 1951 | return 0; |
| @@ -2404,6 +2405,10 @@ static int rbd_obj_issue_copyup(struct rbd_obj_request *obj_req, u32 bytes) | |||
| 2404 | rbd_assert(0); | 2405 | rbd_assert(0); |
| 2405 | } | 2406 | } |
| 2406 | 2407 | ||
| 2408 | ret = ceph_osdc_alloc_messages(obj_req->osd_req, GFP_NOIO); | ||
| 2409 | if (ret) | ||
| 2410 | return ret; | ||
| 2411 | |||
| 2407 | rbd_obj_request_submit(obj_req); | 2412 | rbd_obj_request_submit(obj_req); |
| 2408 | return 0; | 2413 | return 0; |
| 2409 | } | 2414 | } |
| @@ -3783,10 +3788,6 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev, | |||
| 3783 | ceph_oloc_copy(&req->r_base_oloc, oloc); | 3788 | ceph_oloc_copy(&req->r_base_oloc, oloc); |
| 3784 | req->r_flags = CEPH_OSD_FLAG_READ; | 3789 | req->r_flags = CEPH_OSD_FLAG_READ; |
| 3785 | 3790 | ||
| 3786 | ret = ceph_osdc_alloc_messages(req, GFP_KERNEL); | ||
| 3787 | if (ret) | ||
| 3788 | goto out_req; | ||
| 3789 | |||
| 3790 | pages = ceph_alloc_page_vector(num_pages, GFP_KERNEL); | 3791 | pages = ceph_alloc_page_vector(num_pages, GFP_KERNEL); |
| 3791 | if (IS_ERR(pages)) { | 3792 | if (IS_ERR(pages)) { |
| 3792 | ret = PTR_ERR(pages); | 3793 | ret = PTR_ERR(pages); |
| @@ -3797,6 +3798,10 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev, | |||
| 3797 | osd_req_op_extent_osd_data_pages(req, 0, pages, buf_len, 0, false, | 3798 | osd_req_op_extent_osd_data_pages(req, 0, pages, buf_len, 0, false, |
| 3798 | true); | 3799 | true); |
| 3799 | 3800 | ||
| 3801 | ret = ceph_osdc_alloc_messages(req, GFP_KERNEL); | ||
| 3802 | if (ret) | ||
| 3803 | goto out_req; | ||
| 3804 | |||
| 3800 | ceph_osdc_start_request(osdc, req, false); | 3805 | ceph_osdc_start_request(osdc, req, false); |
| 3801 | ret = ceph_osdc_wait_request(osdc, req); | 3806 | ret = ceph_osdc_wait_request(osdc, req); |
| 3802 | if (ret >= 0) | 3807 | if (ret >= 0) |
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 0265f9ae0ab9..0fa6b6b6ccbc 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
| @@ -870,6 +870,11 @@ static void ceph_aio_retry_work(struct work_struct *work) | |||
| 870 | ceph_oloc_copy(&req->r_base_oloc, &orig_req->r_base_oloc); | 870 | ceph_oloc_copy(&req->r_base_oloc, &orig_req->r_base_oloc); |
| 871 | ceph_oid_copy(&req->r_base_oid, &orig_req->r_base_oid); | 871 | ceph_oid_copy(&req->r_base_oid, &orig_req->r_base_oid); |
| 872 | 872 | ||
| 873 | req->r_ops[0] = orig_req->r_ops[0]; | ||
| 874 | |||
| 875 | req->r_mtime = aio_req->mtime; | ||
| 876 | req->r_data_offset = req->r_ops[0].extent.offset; | ||
| 877 | |||
| 873 | ret = ceph_osdc_alloc_messages(req, GFP_NOFS); | 878 | ret = ceph_osdc_alloc_messages(req, GFP_NOFS); |
| 874 | if (ret) { | 879 | if (ret) { |
| 875 | ceph_osdc_put_request(req); | 880 | ceph_osdc_put_request(req); |
| @@ -877,11 +882,6 @@ static void ceph_aio_retry_work(struct work_struct *work) | |||
| 877 | goto out; | 882 | goto out; |
| 878 | } | 883 | } |
| 879 | 884 | ||
| 880 | req->r_ops[0] = orig_req->r_ops[0]; | ||
| 881 | |||
| 882 | req->r_mtime = aio_req->mtime; | ||
| 883 | req->r_data_offset = req->r_ops[0].extent.offset; | ||
| 884 | |||
| 885 | ceph_osdc_put_request(orig_req); | 885 | ceph_osdc_put_request(orig_req); |
| 886 | 886 | ||
| 887 | req->r_callback = ceph_aio_complete_req; | 887 | req->r_callback = ceph_aio_complete_req; |
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index a5fbb38086b6..7ac7f21ff317 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
| @@ -4483,12 +4483,6 @@ alloc_linger_request(struct ceph_osd_linger_request *lreq) | |||
| 4483 | 4483 | ||
| 4484 | ceph_oid_copy(&req->r_base_oid, &lreq->t.base_oid); | 4484 | ceph_oid_copy(&req->r_base_oid, &lreq->t.base_oid); |
| 4485 | ceph_oloc_copy(&req->r_base_oloc, &lreq->t.base_oloc); | 4485 | ceph_oloc_copy(&req->r_base_oloc, &lreq->t.base_oloc); |
| 4486 | |||
| 4487 | if (ceph_osdc_alloc_messages(req, GFP_NOIO)) { | ||
| 4488 | ceph_osdc_put_request(req); | ||
| 4489 | return NULL; | ||
| 4490 | } | ||
| 4491 | |||
| 4492 | return req; | 4486 | return req; |
| 4493 | } | 4487 | } |
| 4494 | 4488 | ||
| @@ -4506,6 +4500,12 @@ alloc_watch_request(struct ceph_osd_linger_request *lreq, u8 watch_opcode) | |||
| 4506 | * filled in by linger_submit(). | 4500 | * filled in by linger_submit(). |
| 4507 | */ | 4501 | */ |
| 4508 | osd_req_op_watch_init(req, 0, 0, watch_opcode); | 4502 | osd_req_op_watch_init(req, 0, 0, watch_opcode); |
| 4503 | |||
| 4504 | if (ceph_osdc_alloc_messages(req, GFP_NOIO)) { | ||
| 4505 | ceph_osdc_put_request(req); | ||
| 4506 | return NULL; | ||
| 4507 | } | ||
| 4508 | |||
| 4509 | return req; | 4509 | return req; |
| 4510 | } | 4510 | } |
| 4511 | 4511 | ||
| @@ -4656,12 +4656,12 @@ int ceph_osdc_notify_ack(struct ceph_osd_client *osdc, | |||
| 4656 | ceph_oloc_copy(&req->r_base_oloc, oloc); | 4656 | ceph_oloc_copy(&req->r_base_oloc, oloc); |
| 4657 | req->r_flags = CEPH_OSD_FLAG_READ; | 4657 | req->r_flags = CEPH_OSD_FLAG_READ; |
| 4658 | 4658 | ||
| 4659 | ret = ceph_osdc_alloc_messages(req, GFP_NOIO); | 4659 | ret = osd_req_op_notify_ack_init(req, 0, notify_id, cookie, payload, |
| 4660 | payload_len); | ||
| 4660 | if (ret) | 4661 | if (ret) |
| 4661 | goto out_put_req; | 4662 | goto out_put_req; |
| 4662 | 4663 | ||
| 4663 | ret = osd_req_op_notify_ack_init(req, 0, notify_id, cookie, payload, | 4664 | ret = ceph_osdc_alloc_messages(req, GFP_NOIO); |
| 4664 | payload_len); | ||
| 4665 | if (ret) | 4665 | if (ret) |
| 4666 | goto out_put_req; | 4666 | goto out_put_req; |
| 4667 | 4667 | ||
| @@ -4766,6 +4766,10 @@ int ceph_osdc_notify(struct ceph_osd_client *osdc, | |||
| 4766 | response_data), | 4766 | response_data), |
| 4767 | pages, PAGE_SIZE, 0, false, true); | 4767 | pages, PAGE_SIZE, 0, false, true); |
| 4768 | 4768 | ||
| 4769 | ret = ceph_osdc_alloc_messages(lreq->reg_req, GFP_NOIO); | ||
| 4770 | if (ret) | ||
| 4771 | goto out_put_lreq; | ||
| 4772 | |||
| 4769 | linger_submit(lreq); | 4773 | linger_submit(lreq); |
| 4770 | ret = linger_reg_commit_wait(lreq); | 4774 | ret = linger_reg_commit_wait(lreq); |
| 4771 | if (!ret) | 4775 | if (!ret) |
| @@ -4892,10 +4896,6 @@ int ceph_osdc_list_watchers(struct ceph_osd_client *osdc, | |||
| 4892 | ceph_oloc_copy(&req->r_base_oloc, oloc); | 4896 | ceph_oloc_copy(&req->r_base_oloc, oloc); |
| 4893 | req->r_flags = CEPH_OSD_FLAG_READ; | 4897 | req->r_flags = CEPH_OSD_FLAG_READ; |
| 4894 | 4898 | ||
| 4895 | ret = ceph_osdc_alloc_messages(req, GFP_NOIO); | ||
| 4896 | if (ret) | ||
| 4897 | goto out_put_req; | ||
| 4898 | |||
| 4899 | pages = ceph_alloc_page_vector(1, GFP_NOIO); | 4899 | pages = ceph_alloc_page_vector(1, GFP_NOIO); |
| 4900 | if (IS_ERR(pages)) { | 4900 | if (IS_ERR(pages)) { |
| 4901 | ret = PTR_ERR(pages); | 4901 | ret = PTR_ERR(pages); |
| @@ -4907,6 +4907,10 @@ int ceph_osdc_list_watchers(struct ceph_osd_client *osdc, | |||
| 4907 | response_data), | 4907 | response_data), |
| 4908 | pages, PAGE_SIZE, 0, false, true); | 4908 | pages, PAGE_SIZE, 0, false, true); |
| 4909 | 4909 | ||
| 4910 | ret = ceph_osdc_alloc_messages(req, GFP_NOIO); | ||
| 4911 | if (ret) | ||
| 4912 | goto out_put_req; | ||
| 4913 | |||
| 4910 | ceph_osdc_start_request(osdc, req, false); | 4914 | ceph_osdc_start_request(osdc, req, false); |
| 4911 | ret = ceph_osdc_wait_request(osdc, req); | 4915 | ret = ceph_osdc_wait_request(osdc, req); |
| 4912 | if (ret >= 0) { | 4916 | if (ret >= 0) { |
| @@ -4969,10 +4973,6 @@ int ceph_osdc_call(struct ceph_osd_client *osdc, | |||
| 4969 | ceph_oloc_copy(&req->r_base_oloc, oloc); | 4973 | ceph_oloc_copy(&req->r_base_oloc, oloc); |
| 4970 | req->r_flags = flags; | 4974 | req->r_flags = flags; |
| 4971 | 4975 | ||
| 4972 | ret = ceph_osdc_alloc_messages(req, GFP_NOIO); | ||
| 4973 | if (ret) | ||
| 4974 | goto out_put_req; | ||
| 4975 | |||
| 4976 | ret = osd_req_op_cls_init(req, 0, class, method); | 4976 | ret = osd_req_op_cls_init(req, 0, class, method); |
| 4977 | if (ret) | 4977 | if (ret) |
| 4978 | goto out_put_req; | 4978 | goto out_put_req; |
| @@ -4984,6 +4984,10 @@ int ceph_osdc_call(struct ceph_osd_client *osdc, | |||
| 4984 | osd_req_op_cls_response_data_pages(req, 0, &resp_page, | 4984 | osd_req_op_cls_response_data_pages(req, 0, &resp_page, |
| 4985 | *resp_len, 0, false, false); | 4985 | *resp_len, 0, false, false); |
| 4986 | 4986 | ||
| 4987 | ret = ceph_osdc_alloc_messages(req, GFP_NOIO); | ||
| 4988 | if (ret) | ||
| 4989 | goto out_put_req; | ||
| 4990 | |||
| 4987 | ceph_osdc_start_request(osdc, req, false); | 4991 | ceph_osdc_start_request(osdc, req, false); |
| 4988 | ret = ceph_osdc_wait_request(osdc, req); | 4992 | ret = ceph_osdc_wait_request(osdc, req); |
| 4989 | if (ret >= 0) { | 4993 | if (ret >= 0) { |
