aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/file.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-04-03 22:32:51 -0400
committerSage Weil <sage@inktank.com>2013-05-02 00:18:12 -0400
commit79528734f3ae4699a2886f62f55e18fb34fb3651 (patch)
tree51905378486b592fc2d4037d67ef3b577fe4eaa7 /fs/ceph/file.c
parent430c28c3cb7f3dbd87de266ed52d65928957ff78 (diff)
libceph: keep source rather than message osd op array
An osd request keeps a pointer to the osd operations (ops) array that it builds in its request message. In order to allow each op in the array to have its own distinct data, we will need to keep track of each op's data, and that information does not go over the wire. As long as we're tracking the data we might as well just track the entire (source) op definition for each of the ops. And if we're doing that, we'll have no more need to keep a pointer to the wire-encoded version. This patch makes the array of source ops be kept with the osd request structure, and uses that instead of the version encoded in the message in places where that was previously used. The array will be embedded in the request structure, and the maximum number of ops we ever actually use is currently 2. So reduce CEPH_OSD_MAX_OP to 2 to reduce the size of the structure. The result of doing this sort of ripples back up, and as a result various function parameters and local variables become unnecessary. Make r_num_ops be unsigned, and move the definition of struct ceph_osd_req_op earlier to ensure it's defined where needed. It does not yet add per-op data, that's coming soon. This resolves: http://tracker.ceph.com/issues/4656 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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index da642af14a28..a12f47642c40 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -478,7 +478,6 @@ static ssize_t ceph_sync_write(struct file *file, const char __user *data,
478 struct ceph_snap_context *snapc; 478 struct ceph_snap_context *snapc;
479 struct ceph_vino vino; 479 struct ceph_vino vino;
480 struct ceph_osd_request *req; 480 struct ceph_osd_request *req;
481 struct ceph_osd_req_op ops[2];
482 int num_ops = 1; 481 int num_ops = 1;
483 struct page **pages; 482 struct page **pages;
484 int num_pages; 483 int num_pages;
@@ -534,7 +533,7 @@ more:
534 snapc = ci->i_snap_realm->cached_context; 533 snapc = ci->i_snap_realm->cached_context;
535 vino = ceph_vino(inode); 534 vino = ceph_vino(inode);
536 req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout, 535 req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout,
537 vino, pos, &len, num_ops, ops, 536 vino, pos, &len, num_ops,
538 CEPH_OSD_OP_WRITE, flags, snapc, 537 CEPH_OSD_OP_WRITE, flags, snapc,
539 ci->i_truncate_seq, ci->i_truncate_size, 538 ci->i_truncate_seq, ci->i_truncate_size,
540 false); 539 false);
@@ -579,8 +578,7 @@ more:
579 false, own_pages); 578 false, own_pages);
580 579
581 /* BUG_ON(vino.snap != CEPH_NOSNAP); */ 580 /* BUG_ON(vino.snap != CEPH_NOSNAP); */
582 ceph_osdc_build_request(req, pos, num_ops, ops, 581 ceph_osdc_build_request(req, pos, snapc, vino.snap, &mtime);
583 snapc, vino.snap, &mtime);
584 582
585 ret = ceph_osdc_start_request(&fsc->client->osdc, req, false); 583 ret = ceph_osdc_start_request(&fsc->client->osdc, req, false);
586 if (!ret) { 584 if (!ret) {