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

Function FileSize

src/libcephsqlite.cc:441–463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439
440
441static int FileSize(sqlite3_file *file, sqlite_int64 *osize)
442{
443 auto f = (cephsqlite_file*)file;
444 auto start = ceph::coarse_mono_clock::now();
445 df(5) << dendl;
446
447 uint64_t size = 0;
448 if (int rc = f->io.rs->stat(&size); rc < 0) {
449 df(5) << "stat failed: " << cpp_strerror(rc) << dendl;
450 if (rc == -EBLOCKLISTED) {
451 getdata(f->vfs).maybe_reconnect(f->io.cluster);
452 }
453 return SQLITE_NOTFOUND;
454 }
455
456 *osize = (sqlite_int64)size;
457
458 df(5) << "= " << size << dendl;
459
460 auto end = ceph::coarse_mono_clock::now();
461 getdata(f->vfs).logger->tinc(P_OPF_FILESIZE, end-start);
462 return SQLITE_OK;
463}
464
465
466static bool parsepath(std::string_view path, struct cephsqlite_fileloc* fileloc)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected