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

Method invalidate

src/client/FSCrypt.cc:514–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514int FSCryptKeyStore::invalidate(struct fscrypt_remove_key_arg* arg, int user)
515{
516 std::unique_lock rl{lock};
517
518 ceph_fscrypt_key_identifier id;
519 int r = id.init(arg->key_spec);
520 if (r < 0) {
521 return r;
522 }
523
524 FSCryptKeyHandlerRef kh;
525 r = _find(id, kh);
526 if (r < 0) {
527 return r;
528 }
529
530 auto& users = kh->get_users();
531 r = maybe_remove_user(arg, &users, user);
532 if (r == -EUSERS) {
533 r = 0;
534 goto out;
535 }
536
537 kh->present = false;
538
539 //do a final clean up
540 if (!kh->present && kh->di->get_inodes().empty()) {
541 kh->reset(++epoch, nullptr);
542 m.erase(id);
543 } else {
544 r = 0;
545 arg->removal_status_flags |= FSCRYPT_KEY_REMOVAL_STATUS_FLAG_FILES_BUSY;
546 }
547
548out:
549 return r;
550}
551
552FSCryptKeyValidator::FSCryptKeyValidator(CephContext *cct, FSCryptKeyHandlerRef& kh, int64_t e) : cct(cct), handler(kh), epoch(e) {
553}

Callers 1

remove_fscrypt_keyMethod · 0.45

Calls 5

initMethod · 0.45
emptyMethod · 0.45
get_inodesMethod · 0.45
resetMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected