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

Function Truncate

src/libcephsqlite.cc:400–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398}
399
400static int Truncate(sqlite3_file *file, sqlite_int64 size)
401{
402 auto f = (cephsqlite_file*)file;
403 auto start = ceph::coarse_mono_clock::now();
404 df(5) << size << dendl;
405
406 if (int rc = f->io.rs->truncate(size); rc < 0) {
407 df(5) << "truncate failed: " << cpp_strerror(rc) << dendl;
408 if (rc == -EBLOCKLISTED) {
409 getdata(f->vfs).maybe_reconnect(f->io.cluster);
410 }
411 return SQLITE_IOERR;
412 }
413
414 auto end = ceph::coarse_mono_clock::now();
415 getdata(f->vfs).logger->tinc(P_OPF_TRUNCATE, end-start);
416 return SQLITE_OK;
417}
418
419static int Sync(sqlite3_file *file, int flags)
420{

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected