summaryrefslogtreecommitdiffstats
path: root/fs/ceph/file.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-03-14 14:09:06 -0500
committerSage Weil <sage@inktank.com>2013-05-01 21:18:01 -0700
commit02ee07d3002e6c0b0c4ea1982cd7e6aeca203ed6 (patch)
tree1e06ce866c06a3fd03d4b6d9547c5bd376c8758f /fs/ceph/file.c
parent88486957f9fbf52ff4313ff52d583110a6503c28 (diff)
downloadlinux-02ee07d3002e6c0b0c4ea1982cd7e6aeca203ed6.tar.bz2
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 'fs/ceph/file.c')
-rw-r--r--fs/ceph/file.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 3d6dcf23b4ad..47826c2ef511 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -540,9 +540,6 @@ more:
if (IS_ERR(req))
return PTR_ERR(req);
- ceph_osdc_build_request(req, pos, num_ops, ops,
- snapc, vino.snap, &mtime);
-
/* write from beginning of first page, regardless of io alignment */
page_align = file->f_flags & O_DIRECT ? buf_align : io_align;
num_pages = calc_pages_for(page_align, len);
@@ -583,6 +580,10 @@ more:
req->r_data_out.alignment = page_align;
req->r_inode = inode;
+ /* BUG_ON(vino.snap != CEPH_NOSNAP); */
+ ceph_osdc_build_request(req, pos, num_ops, ops,
+ snapc, vino.snap, &mtime);
+
ret = ceph_osdc_start_request(&fsc->client->osdc, req, false);
if (!ret) {
if (req->r_safe_callback) {