aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-11-13 22:11:15 -0500
committerAlex Elder <elder@inktank.com>2013-01-17 17:34:57 -0500
commitae7ca4a35b1f5df86e2c32b2cfc01a8d528c7b8c (patch)
treea6dfed1fd8f50cf59cd72be27408f51ee621607c /include
parentd07c09589f533db9ab500ac38151bc9f3a4d0648 (diff)
libceph: pass num_op with ops
Both ceph_osdc_alloc_request() and ceph_osdc_build_request() are provided an array of ceph osd request operations. Rather than just passing the number of operations in the array, the caller is required append an additional zeroed operation structure to signal the end of the array. All callers know the number of operations at the time these functions are called, so drop the silly zero entry and supply that number directly. As a result, get_num_ops() is no longer needed. This also means that ceph_osdc_alloc_request() never uses its ops argument, so that can be dropped. Also rbd_create_rw_ops() no longer needs to add one to reserve room for the additional op. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ceph/osd_client.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index 75f56d372d44..2b04d054e09d 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -214,12 +214,13 @@ extern int ceph_calc_raw_layout(struct ceph_file_layout *layout,
214 214
215extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, 215extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc,
216 struct ceph_snap_context *snapc, 216 struct ceph_snap_context *snapc,
217 struct ceph_osd_req_op *ops, 217 unsigned int num_op,
218 bool use_mempool, 218 bool use_mempool,
219 gfp_t gfp_flags); 219 gfp_t gfp_flags);
220 220
221extern void ceph_osdc_build_request(struct ceph_osd_request *req, 221extern void ceph_osdc_build_request(struct ceph_osd_request *req,
222 u64 off, u64 len, 222 u64 off, u64 len,
223 unsigned int num_op,
223 struct ceph_osd_req_op *src_ops, 224 struct ceph_osd_req_op *src_ops,
224 struct ceph_snap_context *snapc, 225 struct ceph_snap_context *snapc,
225 u64 snap_id, 226 u64 snap_id,