| 398 | } |
| 399 | |
| 400 | static 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 | |
| 419 | static int Sync(sqlite3_file *file, int flags) |
| 420 | { |
nothing calls this directly
no test coverage detected