| 439 | |
| 440 | |
| 441 | static 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 | |
| 466 | static bool parsepath(std::string_view path, struct cephsqlite_fileloc* fileloc) |
nothing calls this directly
no test coverage detected