diff options
author | Alex Elder <elder@inktank.com> | 2013-03-14 15:09:06 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:18:01 -0400 |
commit | 02ee07d3002e6c0b0c4ea1982cd7e6aeca203ed6 (patch) | |
tree | 1e06ce866c06a3fd03d4b6d9547c5bd376c8758f /net/ceph | |
parent | 88486957f9fbf52ff4313ff52d583110a6503c28 (diff) |
libceph: hold off building osd request
Defer building the osd request until just before submitting it in
all callers except ceph_writepages_start(). (That caller will be
handed in the next patch.)
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'net/ceph')
-rw-r--r-- | net/ceph/osd_client.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 115790aac30a..9ca693d0df19 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -2056,8 +2056,6 @@ int ceph_osdc_readpages(struct ceph_osd_client *osdc, | |||
2056 | if (IS_ERR(req)) | 2056 | if (IS_ERR(req)) |
2057 | return PTR_ERR(req); | 2057 | return PTR_ERR(req); |
2058 | 2058 | ||
2059 | ceph_osdc_build_request(req, off, 1, &op, NULL, vino.snap, NULL); | ||
2060 | |||
2061 | /* it may be a short read due to an object boundary */ | 2059 | /* it may be a short read due to an object boundary */ |
2062 | 2060 | ||
2063 | osd_data = &req->r_data_in; | 2061 | osd_data = &req->r_data_in; |
@@ -2069,6 +2067,8 @@ int ceph_osdc_readpages(struct ceph_osd_client *osdc, | |||
2069 | dout("readpages final extent is %llu~%llu (%llu bytes align %d)\n", | 2067 | dout("readpages final extent is %llu~%llu (%llu bytes align %d)\n", |
2070 | off, *plen, osd_data->length, page_align); | 2068 | off, *plen, osd_data->length, page_align); |
2071 | 2069 | ||
2070 | ceph_osdc_build_request(req, off, 1, &op, NULL, vino.snap, NULL); | ||
2071 | |||
2072 | rc = ceph_osdc_start_request(osdc, req, false); | 2072 | rc = ceph_osdc_start_request(osdc, req, false); |
2073 | if (!rc) | 2073 | if (!rc) |
2074 | rc = ceph_osdc_wait_request(osdc, req); | 2074 | rc = ceph_osdc_wait_request(osdc, req); |
@@ -2105,8 +2105,6 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino, | |||
2105 | if (IS_ERR(req)) | 2105 | if (IS_ERR(req)) |
2106 | return PTR_ERR(req); | 2106 | return PTR_ERR(req); |
2107 | 2107 | ||
2108 | ceph_osdc_build_request(req, off, 1, &op, snapc, CEPH_NOSNAP, mtime); | ||
2109 | |||
2110 | /* it may be a short write due to an object boundary */ | 2108 | /* it may be a short write due to an object boundary */ |
2111 | osd_data = &req->r_data_out; | 2109 | osd_data = &req->r_data_out; |
2112 | osd_data->type = CEPH_OSD_DATA_TYPE_PAGES; | 2110 | osd_data->type = CEPH_OSD_DATA_TYPE_PAGES; |
@@ -2115,6 +2113,8 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino, | |||
2115 | osd_data->alignment = page_align; | 2113 | osd_data->alignment = page_align; |
2116 | dout("writepages %llu~%llu (%llu bytes)\n", off, len, osd_data->length); | 2114 | dout("writepages %llu~%llu (%llu bytes)\n", off, len, osd_data->length); |
2117 | 2115 | ||
2116 | ceph_osdc_build_request(req, off, 1, &op, snapc, CEPH_NOSNAP, mtime); | ||
2117 | |||
2118 | rc = ceph_osdc_start_request(osdc, req, true); | 2118 | rc = ceph_osdc_start_request(osdc, req, true); |
2119 | if (!rc) | 2119 | if (!rc) |
2120 | rc = ceph_osdc_wait_request(osdc, req); | 2120 | rc = ceph_osdc_wait_request(osdc, req); |