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

Method write_extent

src/tools/rbd/action/Export.cc:101–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99 bufferlist m_read_data;
100
101 static int write_extent(ExportDiffContext *edc, uint64_t offset,
102 uint64_t length, bool exists, int export_format) {
103 // extent
104 bufferlist bl;
105 __u8 tag = exists ? RBD_DIFF_WRITE : RBD_DIFF_ZERO;
106 uint64_t len = 0;
107 encode(tag, bl);
108 if (export_format == 2) {
109 if (tag == RBD_DIFF_WRITE)
110 len = 8 + 8 + length;
111 else
112 len = 8 + 8;
113 encode(len, bl);
114 }
115 encode(offset, bl);
116 encode(length, bl);
117 int r = bl.write_fd(edc->fd);
118
119 edc->pc.update_progress(offset, edc->totalsize);
120 return r;
121 }
122};
123
124

Callers

nothing calls this directly

Calls 3

encodeFunction · 0.50
write_fdMethod · 0.45
update_progressMethod · 0.45

Tested by

no test coverage detected