Skip to content

Commit 2d3c92d

Browse files
committed
clean unused fields in s3fs
1 parent 6eba75b commit 2d3c92d

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ async fn run(args: ServerConfig) -> anyhow::Result<()> {
149149
args.inline_metadata_size,
150150
Some(args.durability),
151151
);
152-
let s3fs = s3_cas::s3fs::S3FS::new(args.fs_root, args.meta_root, casfs, metrics.clone());
152+
let s3fs = s3_cas::s3fs::S3FS::new(casfs, metrics.clone());
153153
let s3fs = s3_cas::metrics::MetricFs::new(s3fs, metrics.clone());
154154

155155
// Setup S3 service

src/s3fs.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::io::{self, ErrorKind};
2-
use std::path::PathBuf;
32

43
use bytes::Bytes;
54
use faster_hex::{hex_decode, hex_string};
@@ -36,32 +35,18 @@ const MAX_KEYS: i32 = 1000;
3635

3736
#[derive(Debug)]
3837
pub struct S3FS {
39-
root: PathBuf,
4038
casfs: CasFS,
4139
metrics: SharedMetrics,
4240
}
4341

4442
use crate::cas::range_request::RangeRequest;
4543
impl S3FS {
46-
pub fn new(
47-
mut root: PathBuf,
48-
mut meta_path: PathBuf,
49-
casfs: CasFS,
50-
metrics: SharedMetrics,
51-
) -> Self {
52-
meta_path.push("db");
53-
root.push("blocks");
54-
55-
//let db = sled::open(meta_path).unwrap();
44+
pub fn new(casfs: CasFS, metrics: SharedMetrics) -> Self {
5645
// Get the current amount of buckets
5746
// FIXME: This is a bit of a hack, we should have a better way to get the amount of buckets
5847
metrics.set_bucket_count(1); //db.open_tree(BUCKET_META_TREE).unwrap().len());
5948

60-
Self {
61-
root,
62-
casfs,
63-
metrics,
64-
}
49+
Self { casfs, metrics }
6550
}
6651

6752
// Compute the e_tag of the multpart upload. Per the S3 standard (according to minio), the
@@ -392,7 +377,7 @@ impl S3 for S3FS {
392377
let mut block_size = 0;
393378
for block in blocks {
394379
block_size += block.size();
395-
paths.push((block.disk_path(self.root.clone()), block.size()));
380+
paths.push((block.disk_path(self.casfs.fs_root().clone()), block.size()));
396381
}
397382

398383
debug_assert!(obj_meta.size() as usize == block_size);

tests/it_s3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static CONFIG: Lazy<SdkConfig> = Lazy::new(|| {
8787
inlined_size,
8888
None,
8989
);
90-
let s3fs = s3_cas::s3fs::S3FS::new(FS_ROOT.into(), FS_ROOT.into(), casfs, metrics.clone());
90+
let s3fs = s3_cas::s3fs::S3FS::new(casfs, metrics.clone());
9191

9292
// Setup S3 service
9393
let service = {

0 commit comments

Comments
 (0)