aboutsummaryrefslogtreecommitdiff
path: root/fs/ceph/file.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-04-03 21:32:51 -0500
committerSage Weil <sage@inktank.com>2013-05-01 21:18:12 -0700
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 da642af14a2..a12f47642c4 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,
struct ceph_snap_context *snapc;
struct ceph_vino vino;
struct ceph_osd_request *req;
- struct ceph_osd_req_op ops[2];
int num_ops = 1;
struct page **pages;
int num_pages;
@@ -534,7 +533,7 @@ more:
snapc = ci->i_snap_realm->cached_context;
vino = ceph_vino(inode);
req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout,
- vino, pos, &len, num_ops, ops,
+ vino, pos, &len, num_ops,
CEPH_OSD_OP_WRITE, flags, snapc,
ci->i_truncate_seq, ci->i_truncate_size,
false);
@@ -579,8 +578,7 @@ more:
false, own_pages);
/* BUG_ON(vino.snap != CEPH_NOSNAP); */
- ceph_osdc_build_request(req, pos, num_ops, ops,
- snapc, vino.snap, &mtime);
+ ceph_osdc_build_request(req, pos, snapc, vino.snap, &mtime);
ret = ceph_osdc_start_request(&fsc->client->osdc, req, false);
if (!ret) {