| 493 | } |
| 494 | |
| 495 | void Client::tear_down_cache() |
| 496 | { |
| 497 | // fd's |
| 498 | for (auto &[fd, fh] : fd_map) { |
| 499 | ldout(cct, 1) << __func__ << " forcing close of fh " << fd << " ino " << fh->inode->ino << dendl; |
| 500 | _release_fh(fh); |
| 501 | } |
| 502 | fd_map.clear(); |
| 503 | |
| 504 | while (!opened_dirs.empty()) { |
| 505 | dir_result_t *dirp = *opened_dirs.begin(); |
| 506 | ldout(cct, 1) << __func__ << " forcing close of dir " << dirp << " ino " << dirp->inode->ino << dendl; |
| 507 | _closedir(dirp); |
| 508 | } |
| 509 | |
| 510 | // caps! |
| 511 | // *** FIXME *** |
| 512 | |
| 513 | // empty lru |
| 514 | trim_cache(); |
| 515 | ceph_assert(lru.lru_get_size() == 0); |
| 516 | |
| 517 | // close root ino |
| 518 | ceph_assert(inode_map.size() <= 1 + root_parents.size()); |
| 519 | if (root && inode_map.size() == 1 + root_parents.size()) { |
| 520 | root.reset(); |
| 521 | } |
| 522 | |
| 523 | ceph_assert(inode_map.empty()); |
| 524 | } |
| 525 | |
| 526 | inodeno_t Client::_get_root_ino(bool fake) |
| 527 | { |