aboutsummaryrefslogtreecommitdiff
path: root/src/block/rc.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-03-15 12:31:23 +0100
committerAlex Auvolat <alex@adnab.me>2022-03-23 10:25:19 +0100
commite480aaf338e3dfa280f0a78921c024265c811458 (patch)
treeecfa923127094b492154fa482ca3da8de64b8d90 /src/block/rc.rs
parent8fd6745745f5676b5e80920792fa23453f3a20d7 (diff)
downloadgarage-e480aaf338e3dfa280f0a78921c024265c811458.tar.gz
garage-e480aaf338e3dfa280f0a78921c024265c811458.zip
Make background tranquility a configurable parameter
Diffstat (limited to 'src/block/rc.rs')
-rw-r--r--src/block/rc.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/block/rc.rs b/src/block/rc.rs
index 0f497c9b..ec3ea44e 100644
--- a/src/block/rc.rs
+++ b/src/block/rc.rs
@@ -1,7 +1,7 @@
use std::convert::TryInto;
-use garage_util::error::*;
use garage_util::data::*;
+use garage_util::error::*;
use garage_util::time::*;
use crate::manager::BLOCK_GC_DELAY;
@@ -12,9 +12,7 @@ pub struct BlockRc {
impl BlockRc {
pub(crate) fn new(rc: sled::Tree) -> Self {
- Self {
- rc
- }
+ Self { rc }
}
/// Increment the reference counter associated to a hash.
@@ -34,7 +32,7 @@ impl BlockRc {
.rc
.update_and_fetch(&hash, |old| RcEntry::parse_opt(old).decrement().serialize())?;
let new_rc = RcEntry::parse_opt(new_rc);
- Ok(matches!(new_rc, RcEntry::Deletable {..}))
+ Ok(matches!(new_rc, RcEntry::Deletable { .. }))
}
/// Read a block's reference count