MCPcopy Create free account
hub / github.com/ceph/ceph / tear_down_cache

Method tear_down_cache

src/client/Client.cc:495–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493}
494
495void 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
526inodeno_t Client::_get_root_ino(bool fake)
527{

Callers

nothing calls this directly

Calls 6

lru_get_sizeMethod · 0.80
clearMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected