aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ceph
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-03-14 15:09:05 -0400
committerSage Weil <sage@inktank.com>2013-05-02 00:17:58 -0400
commitacead002b200569273bed331c93c4a91d25e10b8 (patch)
tree779bf689da149acf73bd75f51641f3700469f6b7 /include/linux/ceph
parenta19308048182d5f9e16b03b1d1c038d9346c7589 (diff)
libceph: don't build request in ceph_osdc_new_request()
This patch moves the call to ceph_osdc_build_request() out of ceph_osdc_new_request() and into its caller. This is in order to defer formatting osd operation information into the request message until just before request is started. The only unusual (ab)user of ceph_osdc_build_request() is ceph_writepages_start(), where the final length of write request may change (downward) based on the current inode size or the oldest snapshot context with dirty data for the inode. The remaining callers don't change anything in the request after has been built. This means the ops array is now supplied by the caller. It also means there is no need to pass the mtime to ceph_osdc_new_request() (it gets provided to ceph_osdc_build_request()). And rather than passing a do_sync flag, have the number of ops in the ops array supplied imply adding a second STARTSYNC operation after the READ or WRITE requested. This and some of the patches that follow are related to having the messenger (only) be responsible for filling the content of the message header, as described here: http://tracker.ceph.com/issues/4589 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'include/linux/ceph')
-rw-r--r--include/linux/ceph/osd_client.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index fdda93ebbb4c..ffaf9076fdc4 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -243,12 +243,12 @@ extern void osd_req_op_watch_init(struct ceph_osd_req_op *op, u16 opcode,
243 243
244extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, 244extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc,
245 struct ceph_snap_context *snapc, 245 struct ceph_snap_context *snapc,
246 unsigned int num_op, 246 unsigned int num_ops,
247 bool use_mempool, 247 bool use_mempool,
248 gfp_t gfp_flags); 248 gfp_t gfp_flags);
249 249
250extern void ceph_osdc_build_request(struct ceph_osd_request *req, u64 off, 250extern void ceph_osdc_build_request(struct ceph_osd_request *req, u64 off,
251 unsigned int num_op, 251 unsigned int num_ops,
252 struct ceph_osd_req_op *src_ops, 252 struct ceph_osd_req_op *src_ops,
253 struct ceph_snap_context *snapc, 253 struct ceph_snap_context *snapc,
254 u64 snap_id, 254 u64 snap_id,
@@ -257,11 +257,11 @@ extern void ceph_osdc_build_request(struct ceph_osd_request *req, u64 off,
257extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, 257extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *,
258 struct ceph_file_layout *layout, 258 struct ceph_file_layout *layout,
259 struct ceph_vino vino, 259 struct ceph_vino vino,
260 u64 offset, u64 *len, int op, int flags, 260 u64 offset, u64 *len,
261 int num_ops, struct ceph_osd_req_op *ops,
262 int opcode, int flags,
261 struct ceph_snap_context *snapc, 263 struct ceph_snap_context *snapc,
262 int do_sync, u32 truncate_seq, 264 u32 truncate_seq, u64 truncate_size,
263 u64 truncate_size,
264 struct timespec *mtime,
265 bool use_mempool); 265 bool use_mempool);
266 266
267extern void ceph_osdc_set_request_linger(struct ceph_osd_client *osdc, 267extern void ceph_osdc_set_request_linger(struct ceph_osd_client *osdc,