Skip to content

Commit

Permalink
Add origin field to StratFilesystem
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Dec 12, 2023
1 parent 7ffe13a commit f7af1d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/engine/strat_engine/serde_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,6 @@ pub struct FilesystemSave {
pub created: u64, // Unix timestamp
#[serde(skip_serializing_if = "Option::is_none")]
pub fs_size_limit: Option<Sectors>,
#[serde(skip_serializing_if = "Option::is_none")]
pub origin: Option<FilesystemUuid>,
}
5 changes: 5 additions & 0 deletions src/engine/strat_engine/thinpool/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pub struct StratFilesystem {
created: DateTime<Utc>,
used: Option<Bytes>,
size_limit: Option<Sectors>,
origin: Option<FilesystemUuid>,
}

fn init_used(thin_dev: &ThinDev) -> Option<Bytes> {
Expand Down Expand Up @@ -114,6 +115,7 @@ impl StratFilesystem {
thin_dev,
created: Utc::now(),
size_limit,
origin: None,
},
))
}
Expand All @@ -140,6 +142,7 @@ impl StratFilesystem {
thin_dev,
created,
size_limit: fssave.fs_size_limit,
origin: None,
})
}

Expand Down Expand Up @@ -245,6 +248,7 @@ impl StratFilesystem {
thin_dev,
created: Utc::now(),
size_limit: self.size_limit,
origin: None,
})
}
Err(e) => Err(StratisError::Msg(format!(
Expand Down Expand Up @@ -366,6 +370,7 @@ impl StratFilesystem {
size: self.thin_dev.size(),
created: self.created.timestamp() as u64,
fs_size_limit: self.size_limit,
origin: self.origin,
}
}

Expand Down

0 comments on commit f7af1d2

Please sign in to comment.