| 417 | } |
| 418 | |
| 419 | static int Sync(sqlite3_file *file, int flags) |
| 420 | { |
| 421 | auto f = (cephsqlite_file*)file; |
| 422 | auto start = ceph::coarse_mono_clock::now(); |
| 423 | df(5) << flags << dendl; |
| 424 | |
| 425 | if (int rc = f->io.rs->flush(); rc < 0) { |
| 426 | df(5) << "failed: " << cpp_strerror(rc) << dendl; |
| 427 | if (rc == -EBLOCKLISTED) { |
| 428 | getdata(f->vfs).maybe_reconnect(f->io.cluster); |
| 429 | } |
| 430 | return SQLITE_IOERR; |
| 431 | } |
| 432 | |
| 433 | df(5) << " = 0" << dendl; |
| 434 | |
| 435 | auto end = ceph::coarse_mono_clock::now(); |
| 436 | getdata(f->vfs).logger->tinc(P_OPF_SYNC, end-start); |
| 437 | return SQLITE_OK; |
| 438 | } |
| 439 | |
| 440 | |
| 441 | static int FileSize(sqlite3_file *file, sqlite_int64 *osize) |
nothing calls this directly
no test coverage detected