Lines Matching refs:p

50 static int zstd_send_setup(MultiFDSendParams *p, Error **errp)  in zstd_send_setup()  argument
58 error_setg(errp, "multifd %u: zstd createCStream failed", p->id); in zstd_send_setup()
67 p->id, ZSTD_getErrorName(res)); in zstd_send_setup()
76 error_setg(errp, "multifd %u: out of memory for zbuff", p->id); in zstd_send_setup()
79 p->compress_data = z; in zstd_send_setup()
82 p->iov = g_new0(struct iovec, 2); in zstd_send_setup()
94 static void zstd_send_cleanup(MultiFDSendParams *p, Error **errp) in zstd_send_cleanup() argument
96 struct zstd_data *z = p->compress_data; in zstd_send_cleanup()
102 g_free(p->compress_data); in zstd_send_cleanup()
103 p->compress_data = NULL; in zstd_send_cleanup()
105 g_free(p->iov); in zstd_send_cleanup()
106 p->iov = NULL; in zstd_send_cleanup()
120 static int zstd_send_prepare(MultiFDSendParams *p, Error **errp) in zstd_send_prepare() argument
122 MultiFDPages_t *pages = p->pages; in zstd_send_prepare()
123 struct zstd_data *z = p->compress_data; in zstd_send_prepare()
127 if (!multifd_send_prepare_common(p)) { in zstd_send_prepare()
141 z->in.src = p->pages->block->host + pages->offset[i]; in zstd_send_prepare()
142 z->in.size = p->page_size; in zstd_send_prepare()
159 p->id); in zstd_send_prepare()
164 p->id, ZSTD_getErrorName(ret)); in zstd_send_prepare()
168 p->iov[p->iovs_num].iov_base = z->zbuff; in zstd_send_prepare()
169 p->iov[p->iovs_num].iov_len = z->out.pos; in zstd_send_prepare()
170 p->iovs_num++; in zstd_send_prepare()
171 p->next_packet_size = z->out.pos; in zstd_send_prepare()
174 p->flags |= MULTIFD_FLAG_ZSTD; in zstd_send_prepare()
175 multifd_send_fill_packet(p); in zstd_send_prepare()
189 static int zstd_recv_setup(MultiFDRecvParams *p, Error **errp) in zstd_recv_setup() argument
194 p->compress_data = z; in zstd_recv_setup()
198 error_setg(errp, "multifd %u: zstd createDStream failed", p->id); in zstd_recv_setup()
207 p->id, ZSTD_getErrorName(ret)); in zstd_recv_setup()
217 error_setg(errp, "multifd %u: out of memory for zbuff", p->id); in zstd_recv_setup()
230 static void zstd_recv_cleanup(MultiFDRecvParams *p) in zstd_recv_cleanup() argument
232 struct zstd_data *z = p->compress_data; in zstd_recv_cleanup()
238 g_free(p->compress_data); in zstd_recv_cleanup()
239 p->compress_data = NULL; in zstd_recv_cleanup()
253 static int zstd_recv(MultiFDRecvParams *p, Error **errp) in zstd_recv() argument
255 uint32_t in_size = p->next_packet_size; in zstd_recv()
257 uint32_t expected_size = p->normal_num * p->page_size; in zstd_recv()
258 uint32_t flags = p->flags & MULTIFD_FLAG_COMPRESSION_MASK; in zstd_recv()
259 struct zstd_data *z = p->compress_data; in zstd_recv()
265 p->id, flags, MULTIFD_FLAG_ZSTD); in zstd_recv()
269 multifd_recv_zero_page_process(p); in zstd_recv()
271 if (!p->normal_num) { in zstd_recv()
276 ret = qio_channel_read_all(p->c, (void *)z->zbuff, in_size, errp); in zstd_recv()
286 for (i = 0; i < p->normal_num; i++) { in zstd_recv()
287 ramblock_recv_bitmap_set_offset(p->block, p->normal[i]); in zstd_recv()
288 z->out.dst = p->host + p->normal[i]; in zstd_recv()
289 z->out.size = p->page_size; in zstd_recv()
303 && (z->out.pos < p->page_size)); in zstd_recv()
304 if (ret > 0 && (z->out.pos < p->page_size)) { in zstd_recv()
306 p->id); in zstd_recv()
311 p->id, ZSTD_getErrorName(ret)); in zstd_recv()
318 p->id, out_size, expected_size); in zstd_recv()