MCPcopy Create free account
hub / github.com/ceph/ceph / queue_write_head

Function queue_write_head

src/cls/queue/cls_queue_src.cc:20–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18const uint64_t large_chunk_size = 1ul << 22;
19
20int queue_write_head(cls_method_context_t hctx, cls_queue_head& head)
21{
22 bufferlist bl;
23 uint16_t entry_start = QUEUE_HEAD_START;
24 encode(entry_start, bl);
25
26 bufferlist bl_head;
27 encode(head, bl_head);
28
29 uint64_t encoded_len = bl_head.length();
30 encode(encoded_len, bl);
31
32 bl.claim_append(bl_head);
33
34 if (bl.length() > head.max_head_size) {
35 CLS_LOG(0, "ERROR: queue_write_head: invalid head size = %u and urgent data size = %u \n", bl.length(), head.bl_urgent_data.length());
36 return -EINVAL;
37 }
38
39 int ret = cls_cxx_write2(hctx, 0, bl.length(), &bl, CEPH_OSD_OP_FLAG_FADVISE_WILLNEED);
40 if (ret < 0) {
41 CLS_LOG(5, "ERROR: queue_write_head: failed to write head");
42 return ret;
43 }
44 return 0;
45}
46
47int queue_read_head(cls_method_context_t hctx, cls_queue_head& head)
48{

Callers 11

cls_2pc_queue_reserveFunction · 0.85
cls_2pc_queue_commitFunction · 0.85
cls_2pc_queue_abortFunction · 0.85
queue_initFunction · 0.85
cls_queue_enqueueFunction · 0.85
cls_queue_remove_entriesFunction · 0.85
cls_rgw_gc_queue_enqueueFunction · 0.85

Calls 4

encodeFunction · 0.50
cls_cxx_write2Function · 0.50
lengthMethod · 0.45
claim_appendMethod · 0.45

Tested by

no test coverage detected