Skip to content

Commit 2696460

Browse files
jiangliubergwolf
authored andcommitted
Reduce dependent crates
Refine Cargo.toml to reduce dependent crates. root@de1000351b95:/fuse-backend# cargo update Updating crates.io index Removing android_system_properties v0.1.4 Removing atty v0.2.14 Removing bumpalo v3.11.0 Updating caps v0.3.4 -> v0.5.4 Removing cc v1.0.73 Removing chrono v0.4.22 Removing errno v0.2.8 Removing errno-dragonfly v0.1.2 Removing error-chain v0.12.4 Removing futures v0.3.23 Removing futures-channel v0.3.23 Removing futures-executor v0.3.23 Removing futures-io v0.3.23 Removing futures-macro v0.3.23 Removing futures-sink v0.3.23 Removing futures-task v0.3.23 Removing futures-util v0.3.23 Removing hermit-abi v0.1.19 Removing iana-time-zone v0.1.46 Removing js-sys v0.3.59 Removing memchr v2.5.0 Removing num-integer v0.1.45 Removing num-traits v0.2.15 Removing num_cpus v1.13.1 Removing pin-utils v0.1.0 Removing stderrlog v0.5.3 Removing termcolor v1.1.3 Adding thiserror v1.0.32 Adding thiserror-impl v1.0.32 Removing thread_local v1.1.4 Removing time v0.1.44 Removing version_check v0.9.4 Removing vm-memory v0.8.0 Removing wasi v0.10.0+wasi-snapshot-preview1 Removing wasm-bindgen v0.2.82 Removing wasm-bindgen-backend v0.2.82 Removing wasm-bindgen-macro v0.2.82 Removing wasm-bindgen-macro-support v0.2.82 Removing wasm-bindgen-shared v0.2.82 Removing winapi-util v0.1.5 Signed-off-by: Jiang Liu <[email protected]>
1 parent 76dbae8 commit 2696460

File tree

7 files changed

+15
-44
lines changed

7 files changed

+15
-44
lines changed

Cargo.toml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,36 @@ build = "build.rs"
2020
arc-swap = "1.5"
2121
async-trait = { version = "0.1.42", optional = true }
2222
bitflags = "1.1"
23-
futures = { version = "0.3", optional = true }
2423
libc = "0.2.68"
2524
log = "0.4.6"
2625
mio = { version = "0.8", features = ["os-poll", "os-ext"]}
2726
nix = "0.24"
2827
lazy_static = "1.4"
2928
tokio = { version = "1", optional = true }
3029
vmm-sys-util = { version = "0.10", optional = true }
31-
vm-memory = { version = "0.8", features = ["backend-mmap"] }
30+
vm-memory = { version = "0.9", features = ["backend-mmap"] }
3231
virtio-queue = { version = "0.4", optional = true }
3332
vhost = { version = "0.4", features = ["vhost-user-slave"], optional = true }
3433

3534
[target.'cfg(target_os = "macos")'.dependencies]
3635
core-foundation-sys = { version = ">=0.8", optional = true }
3736

3837
[target.'cfg(target_os = "linux")'.dependencies]
39-
caps = { version = "0.3", optional = true }
40-
tokio-uring = "0.3.0"
41-
io-uring = { version = "0.5.2", features = ["unstable"] }
38+
caps = { version = "0.5", optional = true }
39+
tokio-uring = "0.3"
40+
io-uring = { version = "0.5", features = ["unstable"] }
4241
socket2 = { version = "0.4.4", features = ["all"] }
4342
scoped-tls = "1.0.0"
4443
slab = "0.4.6"
4544

4645
[dev-dependencies]
47-
futures = { version = "0.3", features = ["thread-pool"]}
48-
stderrlog = "0.5"
49-
vmm-sys-util = "0.10"
50-
vm-memory = { version = "0.8", features = ["backend-mmap", "backend-bitmap"] }
5146
tokio-test = "0.4.2"
47+
vmm-sys-util = "0.10"
48+
vm-memory = { version = "0.9", features = ["backend-mmap", "backend-bitmap"] }
5249

5350
[features]
5451
default = ["fusedev"]
55-
async-io = ["async-trait", "futures", "tokio/fs", "tokio/net", "tokio/sync", "tokio/rt", "tokio/macros"]
52+
async-io = ["async-trait", "tokio/fs", "tokio/net", "tokio/sync", "tokio/rt", "tokio/macros"]
5653
fusedev = ["vmm-sys-util", "caps", "core-foundation-sys"]
5754
virtiofs = ["virtio-queue", "caps"]
5855
vhost-user-fs = ["virtiofs", "vhost", "caps"]

src/api/vfs/async_io.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,20 +211,19 @@ mod tests {
211211

212212
use std::ffi::CString;
213213

214-
#[test]
215-
fn test_vfs_async_lookup() {
214+
#[tokio::test]
215+
async fn test_vfs_async_lookup() {
216216
let vfs = Vfs::new(VfsOptions::default());
217217
let fs = FakeFileSystemOne {};
218218
let ctx = Context {
219219
uid: 0,
220220
gid: 0,
221221
pid: 0,
222222
};
223-
let executor = futures::executor::ThreadPool::new().unwrap();
224223

225224
assert!(vfs.mount(Box::new(fs), "/x/y").is_ok());
226225

227-
executor.spawn_ok(async move {
226+
let handle = tokio::spawn(async move {
228227
// Lookup inode on pseudo file system.
229228
let name = CString::new("x").unwrap();
230229
let future = vfs.async_lookup(&ctx, ROOT_ID.into(), name.as_c_str());
@@ -253,5 +252,6 @@ mod tests {
253252
.unwrap();
254253
assert_eq!(entry3.inode, 0);
255254
});
255+
handle.await.unwrap();
256256
}
257257
}

src/common/file_traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ pub use async_io::AsyncFileReadWriteVolatile;
454454
mod async_io {
455455
use std::sync::Arc;
456456

457-
use futures::join;
457+
use tokio::join;
458458

459459
use super::*;
460460
use crate::async_file::File;

src/passthrough/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ unsafe impl ByteValued for LinuxDirent64 {}
341341
/// The caching policy that the file system should report to the FUSE client. By default the FUSE
342342
/// protocol uses close-to-open consistency. This means that any cached contents of the file are
343343
/// invalidated the next time that file is opened.
344-
#[derive(Debug, Clone, PartialEq)]
344+
#[derive(Debug, Clone, Eq, PartialEq)]
345345
pub enum CachePolicy {
346346
/// The client should never cache file data and all I/O should be directly forwarded to the
347347
/// server. This policy must be selected when file contents may change without the knowledge of
@@ -379,7 +379,7 @@ impl Default for CachePolicy {
379379
}
380380

381381
/// Options that configure the behavior of the passthrough fuse file system.
382-
#[derive(Debug, Clone, PartialEq)]
382+
#[derive(Debug, Clone, Eq, PartialEq)]
383383
pub struct Config {
384384
/// How long the FUSE client should consider directory entries to be valid. If the contents of a
385385
/// directory can only be modified by the FUSE client (i.e., the file system has exclusive

src/transport/fusedev/macos_session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ fn fuse_kern_umount(file: File, disk: Option<DADiskRef>) -> Result<()> {
429429

430430
fn set_fuse_fd_dead(fd: RawFd) -> std::io::Result<()> {
431431
unsafe {
432-
match ioctl::set_fuse_fd_dead(fd, std::mem::transmute(&fd)) {
432+
match ioctl::set_fuse_fd_dead(fd, &fd as *const i32 as *const u32) {
433433
Ok(_) => Ok(()),
434434
Err(e) => Err(e.into()),
435435
}

tests/macfuse_smoke.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ mod example;
1111

1212
#[cfg(all(feature = "fusedev", target_os = "macos"))]
1313
mod macfuse_tests {
14-
extern crate stderrlog;
15-
1614
use std::io::Result;
1715
use std::process::Command;
1816

@@ -54,17 +52,6 @@ mod macfuse_tests {
5452
return Ok(stdout.to_string());
5553
}
5654

57-
#[test]
58-
fn integration_test_init() -> Result<()> {
59-
stderrlog::new()
60-
.quiet(false)
61-
.timestamp(stderrlog::Timestamp::Microsecond)
62-
.verbosity(log::LevelFilter::Trace as usize - 1)
63-
.init()
64-
.unwrap();
65-
Ok(())
66-
}
67-
6855
#[test]
6956
#[ignore] // it depends on privileged mode to pass through /dev/fuse
7057
fn integration_test_macfuse_hello() -> Result<()> {

tests/smoke.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ mod example;
1111

1212
#[cfg(all(feature = "fusedev", target_os = "linux"))]
1313
mod fusedev_tests {
14-
extern crate stderrlog;
15-
1614
use std::io::Result;
1715
use std::path::Path;
1816
use std::process::Command;
@@ -75,17 +73,6 @@ mod fusedev_tests {
7573
return Ok(stdout.to_string());
7674
}
7775

78-
#[test]
79-
fn integration_test_init() -> Result<()> {
80-
stderrlog::new()
81-
.quiet(false)
82-
.timestamp(stderrlog::Timestamp::Microsecond)
83-
.verbosity(log::LevelFilter::Trace as usize - 1)
84-
.init()
85-
.unwrap();
86-
Ok(())
87-
}
88-
8976
#[test]
9077
#[ignore] // it depends on privileged mode to pass through /dev/fuse
9178
fn integration_test_tree_gitrepo() -> Result<()> {

0 commit comments

Comments
 (0)