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

Function Write

src/libcephsqlite.cc:379–398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379static int Write(sqlite3_file *file, const void *buf, int len, sqlite_int64 off)
380{
381 auto f = (cephsqlite_file*)file;
382 auto start = ceph::coarse_mono_clock::now();
383 df(5) << off << "~" << len << dendl;
384
385 if (int rc = f->io.rs->write(buf, len, off); rc < 0) {
386 df(5) << "write failed: " << cpp_strerror(rc) << dendl;
387 if (rc == -EBLOCKLISTED) {
388 getdata(f->vfs).maybe_reconnect(f->io.cluster);
389 }
390 return SQLITE_IOERR_WRITE;
391 } else {
392 df(5) << "= " << rc << dendl;
393 auto end = ceph::coarse_mono_clock::now();
394 getdata(f->vfs).logger->tinc(P_OPF_WRITE, end-start);
395 return SQLITE_OK;
396 }
397
398}
399
400static int Truncate(sqlite3_file *file, sqlite_int64 size)
401{

Callers

nothing calls this directly

Calls 5

cpp_strerrorFunction · 0.85
maybe_reconnectMethod · 0.80
nowFunction · 0.50
writeMethod · 0.45
tincMethod · 0.45

Tested by

no test coverage detected