Skip to content

Commit

Permalink
Merge pull request #3311 from jbaublitz/crypt-clean-up
Browse files Browse the repository at this point in the history
Clean up crypt module in preparation for metadata rework
  • Loading branch information
mulkieran authored Apr 10, 2023
2 parents 5a4d9e5 + e547611 commit 104a9e4
Show file tree
Hide file tree
Showing 14 changed files with 581 additions and 775 deletions.
10 changes: 6 additions & 4 deletions src/engine/strat_engine/backstore/backstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ use crate::{
blockdev::StratBlockDev,
blockdevmgr::BlockDevMgr,
cache_tier::CacheTier,
crypt::{back_up_luks_header, interpret_clevis_config, restore_luks_header},
crypt::{
back_up_luks_header, interpret_clevis_config, restore_luks_header, CryptHandle,
},
data_tier::DataTier,
devices::UnownedDevices,
shared::BlockSizeSummary,
Expand All @@ -30,7 +32,7 @@ use crate::{
metadata::{MDADataSize, BDA},
names::{format_backstore_ids, CacheRole},
serde_structs::{BackstoreSave, CapSave, Recordable},
shared::{bds_to_bdas, can_unlock},
shared::bds_to_bdas,
types::BDARecordResult,
writing::wipe_sectors,
},
Expand Down Expand Up @@ -726,7 +728,7 @@ impl Backstore {
}

if (existing_pin.as_str(), &config_to_check) == (pin, &parsed_config)
&& can_unlock(
&& CryptHandle::can_unlock(
self.blockdevs()
.get(0)
.expect("Must have at least one blockdev")
Expand Down Expand Up @@ -800,7 +802,7 @@ impl Backstore {

if let Some(kd) = encryption_info.key_description() {
if kd == key_desc {
if can_unlock(
if CryptHandle::can_unlock(
self.blockdevs()
.get(0)
.expect("Must have at least one blockdev")
Expand Down
5 changes: 3 additions & 2 deletions src/engine/strat_engine/backstore/blockdevmgr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ use crate::{
strat_engine::{
backstore::{
blockdev::StratBlockDev,
crypt::CryptHandle,
devices::{initialize_devices, wipe_blockdevs, UnownedDevices},
range_alloc::PerDevSegments,
shared::{BlkDevSegment, Segment},
transaction::RequestTransaction,
},
metadata::{MDADataSize, BDA},
serde_structs::{BaseBlockDevSave, Recordable},
shared::{bds_to_bdas, can_unlock},
shared::bds_to_bdas,
},
types::{DevUuid, EncryptionInfo, Name, PoolEncryptionInfo, PoolUuid},
},
Expand Down Expand Up @@ -114,7 +115,7 @@ impl BlockDevMgr {

let encryption_info = pool_enc_to_enc!(self.encryption_info());
if let Some(ref ei) = encryption_info {
if !can_unlock(
if !CryptHandle::can_unlock(
self.block_devs
.get(0)
.expect("Must have at least one blockdev")
Expand Down
117 changes: 0 additions & 117 deletions src/engine/strat_engine/backstore/crypt/activate.rs

This file was deleted.

Loading

0 comments on commit 104a9e4

Please sign in to comment.