H A D | osd_client.c | 88 static void ceph_osd_data_init(struct ceph_osd_data *osd_data) ceph_osd_data_init() argument 90 memset(osd_data, 0, sizeof (*osd_data)); ceph_osd_data_init() 91 osd_data->type = CEPH_OSD_DATA_TYPE_NONE; ceph_osd_data_init() 94 static void ceph_osd_data_pages_init(struct ceph_osd_data *osd_data, ceph_osd_data_pages_init() argument 98 osd_data->type = CEPH_OSD_DATA_TYPE_PAGES; ceph_osd_data_pages_init() 99 osd_data->pages = pages; ceph_osd_data_pages_init() 100 osd_data->length = length; ceph_osd_data_pages_init() 101 osd_data->alignment = alignment; ceph_osd_data_pages_init() 102 osd_data->pages_from_pool = pages_from_pool; ceph_osd_data_pages_init() 103 osd_data->own_pages = own_pages; ceph_osd_data_pages_init() 106 static void ceph_osd_data_pagelist_init(struct ceph_osd_data *osd_data, ceph_osd_data_pagelist_init() argument 109 osd_data->type = CEPH_OSD_DATA_TYPE_PAGELIST; ceph_osd_data_pagelist_init() 110 osd_data->pagelist = pagelist; ceph_osd_data_pagelist_init() 114 static void ceph_osd_data_bio_init(struct ceph_osd_data *osd_data, ceph_osd_data_bio_init() argument 117 osd_data->type = CEPH_OSD_DATA_TYPE_BIO; ceph_osd_data_bio_init() 118 osd_data->bio = bio; ceph_osd_data_bio_init() 119 osd_data->bio_length = bio_length; ceph_osd_data_bio_init() 143 return osd_req_op_data(osd_req, which, extent, osd_data); osd_req_op_extent_osd_data() 160 struct ceph_osd_data *osd_data; osd_req_op_raw_data_in_pages() local 162 osd_data = osd_req_op_raw_data_in(osd_req, which); osd_req_op_raw_data_in_pages() 163 ceph_osd_data_pages_init(osd_data, pages, length, alignment, osd_req_op_raw_data_in_pages() 173 struct ceph_osd_data *osd_data; osd_req_op_extent_osd_data_pages() local 175 osd_data = osd_req_op_data(osd_req, which, extent, osd_data); osd_req_op_extent_osd_data_pages() 176 ceph_osd_data_pages_init(osd_data, pages, length, alignment, osd_req_op_extent_osd_data_pages() 184 struct ceph_osd_data *osd_data; osd_req_op_extent_osd_data_pagelist() local 186 osd_data = osd_req_op_data(osd_req, which, extent, osd_data); osd_req_op_extent_osd_data_pagelist() 187 ceph_osd_data_pagelist_init(osd_data, pagelist); osd_req_op_extent_osd_data_pagelist() 195 struct ceph_osd_data *osd_data; osd_req_op_extent_osd_data_bio() local 197 osd_data = osd_req_op_data(osd_req, which, extent, osd_data); osd_req_op_extent_osd_data_bio() 198 ceph_osd_data_bio_init(osd_data, bio, bio_length); osd_req_op_extent_osd_data_bio() 207 struct ceph_osd_data *osd_data; osd_req_op_cls_request_info_pagelist() local 209 osd_data = osd_req_op_data(osd_req, which, cls, request_info); osd_req_op_cls_request_info_pagelist() 210 ceph_osd_data_pagelist_init(osd_data, pagelist); osd_req_op_cls_request_info_pagelist() 217 struct ceph_osd_data *osd_data; osd_req_op_cls_request_data_pagelist() local 219 osd_data = osd_req_op_data(osd_req, which, cls, request_data); osd_req_op_cls_request_data_pagelist() 220 ceph_osd_data_pagelist_init(osd_data, pagelist); osd_req_op_cls_request_data_pagelist() 228 struct ceph_osd_data *osd_data; osd_req_op_cls_request_data_pages() local 230 osd_data = osd_req_op_data(osd_req, which, cls, request_data); osd_req_op_cls_request_data_pages() 231 ceph_osd_data_pages_init(osd_data, pages, length, alignment, osd_req_op_cls_request_data_pages() 240 struct ceph_osd_data *osd_data; osd_req_op_cls_response_data_pages() local 242 osd_data = osd_req_op_data(osd_req, which, cls, response_data); osd_req_op_cls_response_data_pages() 243 ceph_osd_data_pages_init(osd_data, pages, length, alignment, osd_req_op_cls_response_data_pages() 248 static u64 ceph_osd_data_length(struct ceph_osd_data *osd_data) ceph_osd_data_length() argument 250 switch (osd_data->type) { ceph_osd_data_length() 254 return osd_data->length; ceph_osd_data_length() 256 return (u64)osd_data->pagelist->length; ceph_osd_data_length() 259 return (u64)osd_data->bio_length; ceph_osd_data_length() 262 WARN(true, "unrecognized data type %d\n", (int)osd_data->type); ceph_osd_data_length() 267 static void ceph_osd_data_release(struct ceph_osd_data *osd_data) ceph_osd_data_release() argument 269 if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGES && osd_data->own_pages) { ceph_osd_data_release() 272 num_pages = calc_pages_for((u64)osd_data->alignment, ceph_osd_data_release() 273 (u64)osd_data->length); ceph_osd_data_release() 274 ceph_release_page_vector(osd_data->pages, num_pages); ceph_osd_data_release() 276 ceph_osd_data_init(osd_data); ceph_osd_data_release() 291 ceph_osd_data_release(&op->extent.osd_data); osd_req_op_data_release() 300 ceph_osd_data_release(&op->xattr.osd_data); osd_req_op_data_release() 589 ceph_osd_data_pagelist_init(&op->xattr.osd_data, pagelist); osd_req_op_xattr_init() 633 struct ceph_osd_data *osd_data) ceph_osdc_msg_data_add() 635 u64 length = ceph_osd_data_length(osd_data); ceph_osdc_msg_data_add() 637 if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGES) { ceph_osdc_msg_data_add() 640 ceph_msg_data_add_pages(msg, osd_data->pages, ceph_osdc_msg_data_add() 641 length, osd_data->alignment); ceph_osdc_msg_data_add() 642 } else if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGELIST) { ceph_osdc_msg_data_add() 644 ceph_msg_data_add_pagelist(msg, osd_data->pagelist); ceph_osdc_msg_data_add() 646 } else if (osd_data->type == CEPH_OSD_DATA_TYPE_BIO) { ceph_osdc_msg_data_add() 647 ceph_msg_data_add_bio(msg, osd_data->bio, length); ceph_osdc_msg_data_add() 650 BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_NONE); ceph_osdc_msg_data_add() 658 struct ceph_osd_data *osd_data; osd_req_encode_op() local 672 osd_data = &src->raw_data_in; osd_req_encode_op() 673 ceph_osdc_msg_data_add(req->r_reply, osd_data); osd_req_encode_op() 689 osd_data = &src->extent.osd_data; osd_req_encode_op() 692 ceph_osdc_msg_data_add(req->r_request, osd_data); osd_req_encode_op() 694 ceph_osdc_msg_data_add(req->r_reply, osd_data); osd_req_encode_op() 699 osd_data = &src->cls.request_info; osd_req_encode_op() 700 ceph_osdc_msg_data_add(req->r_request, osd_data); osd_req_encode_op() 701 BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_PAGELIST); osd_req_encode_op() 702 request_data_len = osd_data->pagelist->length; osd_req_encode_op() 704 osd_data = &src->cls.request_data; osd_req_encode_op() 705 data_length = ceph_osd_data_length(osd_data); osd_req_encode_op() 707 BUG_ON(osd_data->type == CEPH_OSD_DATA_TYPE_NONE); osd_req_encode_op() 709 ceph_osdc_msg_data_add(req->r_request, osd_data); osd_req_encode_op() 713 osd_data = &src->cls.response_data; osd_req_encode_op() 714 ceph_osdc_msg_data_add(req->r_reply, osd_data); osd_req_encode_op() 736 osd_data = &src->xattr.osd_data; osd_req_encode_op() 737 ceph_osdc_msg_data_add(req->r_request, osd_data); osd_req_encode_op() 738 request_data_len = osd_data->pagelist->length; osd_req_encode_op() 632 ceph_osdc_msg_data_add(struct ceph_msg *msg, struct ceph_osd_data *osd_data) ceph_osdc_msg_data_add() argument
|