| 377 | } |
| 378 | |
| 379 | static int Write(sqlite3_file *file, const void *buf, int len, sqlite_int64 off) |
| 380 | { |
| 381 | auto f = (cephsqlite_file*)file; |
| 382 | auto start = ceph::coarse_mono_clock::now(); |
| 383 | df(5) << off << "~" << len << dendl; |
| 384 | |
| 385 | if (int rc = f->io.rs->write(buf, len, off); rc < 0) { |
| 386 | df(5) << "write failed: " << cpp_strerror(rc) << dendl; |
| 387 | if (rc == -EBLOCKLISTED) { |
| 388 | getdata(f->vfs).maybe_reconnect(f->io.cluster); |
| 389 | } |
| 390 | return SQLITE_IOERR_WRITE; |
| 391 | } else { |
| 392 | df(5) << "= " << rc << dendl; |
| 393 | auto end = ceph::coarse_mono_clock::now(); |
| 394 | getdata(f->vfs).logger->tinc(P_OPF_WRITE, end-start); |
| 395 | return SQLITE_OK; |
| 396 | } |
| 397 | |
| 398 | } |
| 399 | |
| 400 | static int Truncate(sqlite3_file *file, sqlite_int64 size) |
| 401 | { |
nothing calls this directly
no test coverage detected