mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
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>
This commit is contained in:
parent
88486957f9
commit
02ee07d300
3 changed files with 10 additions and 9 deletions
|
@ -2056,8 +2056,6 @@ int ceph_osdc_readpages(struct ceph_osd_client *osdc,
|
|||
if (IS_ERR(req))
|
||||
return PTR_ERR(req);
|
||||
|
||||
ceph_osdc_build_request(req, off, 1, &op, NULL, vino.snap, NULL);
|
||||
|
||||
/* it may be a short read due to an object boundary */
|
||||
|
||||
osd_data = &req->r_data_in;
|
||||
|
@ -2069,6 +2067,8 @@ int ceph_osdc_readpages(struct ceph_osd_client *osdc,
|
|||
dout("readpages final extent is %llu~%llu (%llu bytes align %d)\n",
|
||||
off, *plen, osd_data->length, page_align);
|
||||
|
||||
ceph_osdc_build_request(req, off, 1, &op, NULL, vino.snap, NULL);
|
||||
|
||||
rc = ceph_osdc_start_request(osdc, req, false);
|
||||
if (!rc)
|
||||
rc = ceph_osdc_wait_request(osdc, req);
|
||||
|
@ -2105,8 +2105,6 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino,
|
|||
if (IS_ERR(req))
|
||||
return PTR_ERR(req);
|
||||
|
||||
ceph_osdc_build_request(req, off, 1, &op, snapc, CEPH_NOSNAP, mtime);
|
||||
|
||||
/* it may be a short write due to an object boundary */
|
||||
osd_data = &req->r_data_out;
|
||||
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,
|
|||
osd_data->alignment = page_align;
|
||||
dout("writepages %llu~%llu (%llu bytes)\n", off, len, osd_data->length);
|
||||
|
||||
ceph_osdc_build_request(req, off, 1, &op, snapc, CEPH_NOSNAP, mtime);
|
||||
|
||||
rc = ceph_osdc_start_request(osdc, req, true);
|
||||
if (!rc)
|
||||
rc = ceph_osdc_wait_request(osdc, req);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue