diff options
author | Alex Elder <elder@inktank.com> | 2013-04-05 02:27:12 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:18:23 -0400 |
commit | a4ce40a9a7c1053ac2a41cf64255e44e356e5522 (patch) | |
tree | de1aeb42625f19f6cfe8806db333ec853de0f5b7 /include/linux/ceph | |
parent | 39b44cbe86db42e70693787b2ede81c309925d0b (diff) |
libceph: combine initializing and setting osd data
This ends up being a rather large patch but what it's doing is
somewhat straightforward.
Basically, this is replacing two calls with one. The first of the
two calls is initializing a struct ceph_osd_data with data (either a
page array, a page list, or a bio list); the second is setting an
osd request op so it associates that data with one of the op's
parameters. In place of those two will be a single function that
initializes the op directly.
That means we sort of fan out a set of the needed functions:
- extent ops with pages data
- extent ops with pagelist data
- extent ops with bio list data
and
- class ops with page data for receiving a response
We also have define another one, but it's only used internally:
- class ops with pagelist data for request parameters
Note that we *still* haven't gotten rid of the osd request's
r_data_in and r_data_out fields. All the osd ops refer to them for
their data. For now, these data fields are pointers assigned to the
appropriate r_data_* field when these new functions are called.
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.h | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index 71c41575646d..f8a00b48e550 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
@@ -240,17 +240,39 @@ extern void osd_req_op_extent_init(struct ceph_osd_request *osd_req, | |||
240 | u64 truncate_size, u32 truncate_seq); | 240 | u64 truncate_size, u32 truncate_seq); |
241 | extern void osd_req_op_extent_update(struct ceph_osd_request *osd_req, | 241 | extern void osd_req_op_extent_update(struct ceph_osd_request *osd_req, |
242 | unsigned int which, u64 length); | 242 | unsigned int which, u64 length); |
243 | extern void osd_req_op_extent_osd_data(struct ceph_osd_request *osd_req, | 243 | |
244 | extern struct ceph_osd_data *osd_req_op_extent_osd_data( | ||
245 | struct ceph_osd_request *osd_req, | ||
246 | unsigned int which, bool write_request); | ||
247 | extern struct ceph_osd_data *osd_req_op_cls_response_data( | ||
248 | struct ceph_osd_request *osd_req, | ||
249 | unsigned int which); | ||
250 | |||
251 | extern void osd_req_op_extent_osd_data_pages(struct ceph_osd_request *, | ||
252 | unsigned int which, bool write_request, | ||
253 | struct page **pages, u64 length, | ||
254 | u32 alignment, bool pages_from_pool, | ||
255 | bool own_pages); | ||
256 | extern void osd_req_op_extent_osd_data_pagelist(struct ceph_osd_request *, | ||
257 | unsigned int which, bool write_request, | ||
258 | struct ceph_pagelist *pagelist); | ||
259 | #ifdef CONFIG_BLOCK | ||
260 | extern void osd_req_op_extent_osd_data_bio(struct ceph_osd_request *, | ||
261 | unsigned int which, bool write_request, | ||
262 | struct bio *bio, size_t bio_length); | ||
263 | #endif /* CONFIG_BLOCK */ | ||
264 | |||
265 | extern void osd_req_op_cls_response_data_pages(struct ceph_osd_request *, | ||
244 | unsigned int which, | 266 | unsigned int which, |
245 | struct ceph_osd_data *osd_data); | 267 | struct page **pages, u64 length, |
268 | u32 alignment, bool pages_from_pool, | ||
269 | bool own_pages); | ||
270 | |||
246 | extern void osd_req_op_cls_init(struct ceph_osd_request *osd_req, | 271 | extern void osd_req_op_cls_init(struct ceph_osd_request *osd_req, |
247 | unsigned int which, u16 opcode, | 272 | unsigned int which, u16 opcode, |
248 | const char *class, const char *method, | 273 | const char *class, const char *method, |
249 | const void *request_data, | 274 | const void *request_data, |
250 | size_t request_data_size); | 275 | size_t request_data_size); |
251 | extern void osd_req_op_cls_response_data(struct ceph_osd_request *osd_req, | ||
252 | unsigned int which, | ||
253 | struct ceph_osd_data *response_data); | ||
254 | extern void osd_req_op_watch_init(struct ceph_osd_request *osd_req, | 276 | extern void osd_req_op_watch_init(struct ceph_osd_request *osd_req, |
255 | unsigned int which, u16 opcode, | 277 | unsigned int which, u16 opcode, |
256 | u64 cookie, u64 version, int flag); | 278 | u64 cookie, u64 version, int flag); |
@@ -290,17 +312,6 @@ static inline void ceph_osdc_put_request(struct ceph_osd_request *req) | |||
290 | kref_put(&req->r_kref, ceph_osdc_release_request); | 312 | kref_put(&req->r_kref, ceph_osdc_release_request); |
291 | } | 313 | } |
292 | 314 | ||
293 | extern void ceph_osd_data_pages_init(struct ceph_osd_data *osd_data, | ||
294 | struct page **pages, u64 length, | ||
295 | u32 alignment, bool pages_from_pool, | ||
296 | bool own_pages); | ||
297 | extern void ceph_osd_data_pagelist_init(struct ceph_osd_data *osd_data, | ||
298 | struct ceph_pagelist *pagelist); | ||
299 | #ifdef CONFIG_BLOCK | ||
300 | extern void ceph_osd_data_bio_init(struct ceph_osd_data *osd_data, | ||
301 | struct bio *bio, size_t bio_length); | ||
302 | #endif /* CONFIG_BLOCK */ | ||
303 | |||
304 | extern int ceph_osdc_start_request(struct ceph_osd_client *osdc, | 315 | extern int ceph_osdc_start_request(struct ceph_osd_client *osdc, |
305 | struct ceph_osd_request *req, | 316 | struct ceph_osd_request *req, |
306 | bool nofail); | 317 | bool nofail); |