aboutsummaryrefslogtreecommitdiff
path: root/src/block/rc.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-12-13 14:23:45 +0100
committerAlex Auvolat <alex@adnab.me>2022-12-13 14:23:45 +0100
commit687660b27f904422c689e09d2457293e5313d325 (patch)
treedd63404f4d49dc7c146d90e39f855c10db031417 /src/block/rc.rs
parent9d82196945f751c825621573657cfead992b356b (diff)
downloadgarage-687660b27f904422c689e09d2457293e5313d325.tar.gz
garage-687660b27f904422c689e09d2457293e5313d325.zip
Implement `block list-errors` and `block info`
Diffstat (limited to 'src/block/rc.rs')
-rw-r--r--src/block/rc.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/block/rc.rs b/src/block/rc.rs
index ce6defad..8dae3960 100644
--- a/src/block/rc.rs
+++ b/src/block/rc.rs
@@ -169,4 +169,11 @@ impl RcEntry {
pub(crate) fn is_needed(&self) -> bool {
!self.is_deletable()
}
+
+ pub(crate) fn as_u64(&self) -> u64 {
+ match self {
+ RcEntry::Present { count } => *count,
+ _ => 0,
+ }
+ }
}