Lines Matching refs:osd_data
123 static void ceph_osd_data_init(struct ceph_osd_data *osd_data) in ceph_osd_data_init() argument
125 memset(osd_data, 0, sizeof (*osd_data)); in ceph_osd_data_init()
126 osd_data->type = CEPH_OSD_DATA_TYPE_NONE; in ceph_osd_data_init()
132 static void ceph_osd_data_pages_init(struct ceph_osd_data *osd_data, in ceph_osd_data_pages_init() argument
136 osd_data->type = CEPH_OSD_DATA_TYPE_PAGES; in ceph_osd_data_pages_init()
137 osd_data->pages = pages; in ceph_osd_data_pages_init()
138 osd_data->length = length; in ceph_osd_data_pages_init()
139 osd_data->alignment = alignment; in ceph_osd_data_pages_init()
140 osd_data->pages_from_pool = pages_from_pool; in ceph_osd_data_pages_init()
141 osd_data->own_pages = own_pages; in ceph_osd_data_pages_init()
147 static void ceph_osd_data_pagelist_init(struct ceph_osd_data *osd_data, in ceph_osd_data_pagelist_init() argument
150 osd_data->type = CEPH_OSD_DATA_TYPE_PAGELIST; in ceph_osd_data_pagelist_init()
151 osd_data->pagelist = pagelist; in ceph_osd_data_pagelist_init()
155 static void ceph_osd_data_bio_init(struct ceph_osd_data *osd_data, in ceph_osd_data_bio_init() argument
159 osd_data->type = CEPH_OSD_DATA_TYPE_BIO; in ceph_osd_data_bio_init()
160 osd_data->bio_pos = *bio_pos; in ceph_osd_data_bio_init()
161 osd_data->bio_length = bio_length; in ceph_osd_data_bio_init()
165 static void ceph_osd_data_bvecs_init(struct ceph_osd_data *osd_data, in ceph_osd_data_bvecs_init() argument
169 osd_data->type = CEPH_OSD_DATA_TYPE_BVECS; in ceph_osd_data_bvecs_init()
170 osd_data->bvec_pos = *bvec_pos; in ceph_osd_data_bvecs_init()
171 osd_data->num_bvecs = num_bvecs; in ceph_osd_data_bvecs_init()
186 return osd_req_op_data(osd_req, which, extent, osd_data); in osd_req_op_extent_osd_data()
195 struct ceph_osd_data *osd_data; in osd_req_op_raw_data_in_pages() local
197 osd_data = osd_req_op_raw_data_in(osd_req, which); in osd_req_op_raw_data_in_pages()
198 ceph_osd_data_pages_init(osd_data, pages, length, alignment, in osd_req_op_raw_data_in_pages()
208 struct ceph_osd_data *osd_data; in osd_req_op_extent_osd_data_pages() local
210 osd_data = osd_req_op_data(osd_req, which, extent, osd_data); in osd_req_op_extent_osd_data_pages()
211 ceph_osd_data_pages_init(osd_data, pages, length, alignment, in osd_req_op_extent_osd_data_pages()
219 struct ceph_osd_data *osd_data; in osd_req_op_extent_osd_data_pagelist() local
221 osd_data = osd_req_op_data(osd_req, which, extent, osd_data); in osd_req_op_extent_osd_data_pagelist()
222 ceph_osd_data_pagelist_init(osd_data, pagelist); in osd_req_op_extent_osd_data_pagelist()
232 struct ceph_osd_data *osd_data; in osd_req_op_extent_osd_data_bio() local
234 osd_data = osd_req_op_data(osd_req, which, extent, osd_data); in osd_req_op_extent_osd_data_bio()
235 ceph_osd_data_bio_init(osd_data, bio_pos, bio_length); in osd_req_op_extent_osd_data_bio()
245 struct ceph_osd_data *osd_data; in osd_req_op_extent_osd_data_bvecs() local
251 osd_data = osd_req_op_data(osd_req, which, extent, osd_data); in osd_req_op_extent_osd_data_bvecs()
252 ceph_osd_data_bvecs_init(osd_data, &it, num_bvecs); in osd_req_op_extent_osd_data_bvecs()
260 struct ceph_osd_data *osd_data; in osd_req_op_extent_osd_data_bvec_pos() local
262 osd_data = osd_req_op_data(osd_req, which, extent, osd_data); in osd_req_op_extent_osd_data_bvec_pos()
263 ceph_osd_data_bvecs_init(osd_data, bvec_pos, 0); in osd_req_op_extent_osd_data_bvec_pos()
271 struct ceph_osd_data *osd_data; in osd_req_op_cls_request_info_pagelist() local
273 osd_data = osd_req_op_data(osd_req, which, cls, request_info); in osd_req_op_cls_request_info_pagelist()
274 ceph_osd_data_pagelist_init(osd_data, pagelist); in osd_req_op_cls_request_info_pagelist()
281 struct ceph_osd_data *osd_data; in osd_req_op_cls_request_data_pagelist() local
283 osd_data = osd_req_op_data(osd_req, which, cls, request_data); in osd_req_op_cls_request_data_pagelist()
284 ceph_osd_data_pagelist_init(osd_data, pagelist); in osd_req_op_cls_request_data_pagelist()
294 struct ceph_osd_data *osd_data; in osd_req_op_cls_request_data_pages() local
296 osd_data = osd_req_op_data(osd_req, which, cls, request_data); in osd_req_op_cls_request_data_pages()
297 ceph_osd_data_pages_init(osd_data, pages, length, alignment, in osd_req_op_cls_request_data_pages()
309 struct ceph_osd_data *osd_data; in osd_req_op_cls_request_data_bvecs() local
315 osd_data = osd_req_op_data(osd_req, which, cls, request_data); in osd_req_op_cls_request_data_bvecs()
316 ceph_osd_data_bvecs_init(osd_data, &it, num_bvecs); in osd_req_op_cls_request_data_bvecs()
326 struct ceph_osd_data *osd_data; in osd_req_op_cls_response_data_pages() local
328 osd_data = osd_req_op_data(osd_req, which, cls, response_data); in osd_req_op_cls_response_data_pages()
329 ceph_osd_data_pages_init(osd_data, pages, length, alignment, in osd_req_op_cls_response_data_pages()
334 static u64 ceph_osd_data_length(struct ceph_osd_data *osd_data) in ceph_osd_data_length() argument
336 switch (osd_data->type) { in ceph_osd_data_length()
340 return osd_data->length; in ceph_osd_data_length()
342 return (u64)osd_data->pagelist->length; in ceph_osd_data_length()
345 return (u64)osd_data->bio_length; in ceph_osd_data_length()
348 return osd_data->bvec_pos.iter.bi_size; in ceph_osd_data_length()
350 WARN(true, "unrecognized data type %d\n", (int)osd_data->type); in ceph_osd_data_length()
355 static void ceph_osd_data_release(struct ceph_osd_data *osd_data) in ceph_osd_data_release() argument
357 if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGES && osd_data->own_pages) { in ceph_osd_data_release()
360 num_pages = calc_pages_for((u64)osd_data->alignment, in ceph_osd_data_release()
361 (u64)osd_data->length); in ceph_osd_data_release()
362 ceph_release_page_vector(osd_data->pages, num_pages); in ceph_osd_data_release()
363 } else if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGELIST) { in ceph_osd_data_release()
364 ceph_pagelist_release(osd_data->pagelist); in ceph_osd_data_release()
366 ceph_osd_data_init(osd_data); in ceph_osd_data_release()
381 ceph_osd_data_release(&op->extent.osd_data); in osd_req_op_data_release()
390 ceph_osd_data_release(&op->xattr.osd_data); in osd_req_op_data_release()
406 ceph_osd_data_release(&op->copy_from.osd_data); in osd_req_op_data_release()
870 ceph_osd_data_pagelist_init(&op->xattr.osd_data, pagelist); in osd_req_op_xattr_init()
936 struct ceph_osd_data *osd_data) in ceph_osdc_msg_data_add() argument
938 u64 length = ceph_osd_data_length(osd_data); in ceph_osdc_msg_data_add()
940 if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGES) { in ceph_osdc_msg_data_add()
943 ceph_msg_data_add_pages(msg, osd_data->pages, in ceph_osdc_msg_data_add()
944 length, osd_data->alignment, false); in ceph_osdc_msg_data_add()
945 } else if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGELIST) { in ceph_osdc_msg_data_add()
947 ceph_msg_data_add_pagelist(msg, osd_data->pagelist); in ceph_osdc_msg_data_add()
949 } else if (osd_data->type == CEPH_OSD_DATA_TYPE_BIO) { in ceph_osdc_msg_data_add()
950 ceph_msg_data_add_bio(msg, &osd_data->bio_pos, length); in ceph_osdc_msg_data_add()
952 } else if (osd_data->type == CEPH_OSD_DATA_TYPE_BVECS) { in ceph_osdc_msg_data_add()
953 ceph_msg_data_add_bvecs(msg, &osd_data->bvec_pos); in ceph_osdc_msg_data_add()
955 BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_NONE); in ceph_osdc_msg_data_add()
1995 &op->extent.osd_data); in setup_request_data()
2002 &op->xattr.osd_data); in setup_request_data()
2010 &op->copy_from.osd_data); in setup_request_data()
2020 &op->extent.osd_data); in setup_request_data()
2996 struct ceph_osd_data *osd_data = in linger_commit_cb() local
2998 void *p = page_address(osd_data->pages[0]); in linger_commit_cb()
3001 osd_data->type != CEPH_OSD_DATA_TYPE_PAGES); in linger_commit_cb()
5287 ceph_osd_data_pages_init(&op->copy_from.osd_data, pages, in osd_req_op_copy_from_init()