| 12340 | } |
| 12341 | |
| 12342 | bool Client::C_Write_Finisher::try_complete() |
| 12343 | { |
| 12344 | client_t const whoami = clnt->whoami; // For the benefit of ldout prefix |
| 12345 | |
| 12346 | ldout(clnt->cct, 19) << "C_Write_Finisher::try_complete this " << this |
| 12347 | << " onuninlinefinished " << onuninlinefinished |
| 12348 | << " iofinished " << iofinished |
| 12349 | << " iofinished_r " << iofinished_r |
| 12350 | << " fsync_finished " << fsync_finished |
| 12351 | << dendl; |
| 12352 | |
| 12353 | if (onuninlinefinished && iofinished && !fsync_finished && iofinished_r >= 0) { |
| 12354 | // Done with I/O AND uninline, but we want to do fsync |
| 12355 | CWF_fsync_finish *fsync_f = new CWF_fsync_finish(this); |
| 12356 | C_nonblocking_fsync_state *state = new C_nonblocking_fsync_state(clnt, in, syncdataonly, fsync_f); |
| 12357 | |
| 12358 | // Kick fsync off... and all will magically complete eventually... |
| 12359 | ldout(clnt->cct, 19) << "kickoff fsync onfinish " << onfinish << dendl; |
| 12360 | state->advance(); |
| 12361 | } else if (onuninlinefinished && iofinished) { |
| 12362 | // Now we are REALLY done... |
| 12363 | clnt->put_cap_ref(in, CEPH_CAP_FILE_WR); |
| 12364 | |
| 12365 | if (fsync_r < 0) { |
| 12366 | ldout(clnt->cct, 19) << " complete with fsync_r " << fsync_r << dendl; |
| 12367 | onfinish->complete(fsync_r); |
| 12368 | } else if (onuninlinefinished_r < 0 && onuninlinefinished_r != -ECANCELED) { |
| 12369 | ldout(clnt->cct, 19) << " complete with onuninlinefinished_r " << onuninlinefinished_r << dendl; |
| 12370 | onfinish->complete(onuninlinefinished_r); |
| 12371 | } else { |
| 12372 | ldout(clnt->cct, 19) << " complete with iofinished_r " << iofinished_r << dendl; |
| 12373 | onfinish->complete(iofinished_r); |
| 12374 | } |
| 12375 | onfinish = nullptr; |
| 12376 | return true; |
| 12377 | } |
| 12378 | |
| 12379 | return false; |
| 12380 | } |
| 12381 | |
| 12382 | Client::WriteEncMgr::WriteEncMgr(Client *clnt, |
| 12383 | Fh *f, int64_t offset, uint64_t size, |
nothing calls this directly
no test coverage detected