Skip to content

Commit 7d01ba6

Browse files
diqiu50jerryshao
authored andcommitted
[#5877] feat (gvfs-fuse): Implement a common filesystem layer (#5878)
### What changes were proposed in this pull request? Implement a common filesystem layer to handle manage file ids, file name mappings, and file relationships. and delegate filesystem APIs to PathFilesystem. ### Why are the changes needed? Fix: #5877 ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Uts
1 parent d1e2890 commit 7d01ba6

12 files changed

+969
-63
lines changed

clients/filesystem-fuse/.cargo/config.toml

-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@
1616
# under the License.
1717

1818
[build]
19-
target-dir = "build"
2019
rustflags = ["-Adead_code", "-Aclippy::redundant-field-names"]

clients/filesystem-fuse/Cargo.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ name = "gvfs-fuse"
3030
path = "src/main.rs"
3131

3232
[lib]
33-
name="gvfs_fuse"
33+
name = "gvfs_fuse"
3434

3535
[dependencies]
3636
async-trait = "0.1"
3737
bytes = "1.6.0"
38-
futures-util = "0.3.30"
38+
dashmap = "6.1.0"
3939
fuse3 = { version = "0.8.1", "features" = ["tokio-runtime", "unprivileged"] }
40+
futures-util = "0.3.30"
41+
libc = "0.2.168"
4042
log = "0.4.22"
4143
tokio = { version = "1.38.0", features = ["full"] }
4244
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }

clients/filesystem-fuse/Makefile

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
.EXPORT_ALL_VARIABLES:
19+
20+
.PHONY: build
21+
build:
22+
cargo build --all-features --workspace
23+
24+
fmt:
25+
cargo fmt --all
26+
27+
cargo-sort: install-cargo-sort
28+
cargo sort -w
29+
30+
fix-toml: install-taplo-cli
31+
taplo fmt
32+
33+
check-fmt:
34+
cargo fmt --all -- --check
35+
36+
check-clippy:
37+
cargo clippy --all-targets --all-features --workspace -- -D warnings
38+
39+
install-cargo-sort:
40+
cargo install cargo-sort@1.0.9
41+
42+
check-cargo-sort: install-cargo-sort
43+
cargo sort -c
44+
45+
install-cargo-machete:
46+
cargo install cargo-machete
47+
48+
cargo-machete: install-cargo-machete
49+
cargo machete
50+
51+
install-taplo-cli:
52+
cargo install taplo-cli@0.9.0
53+
54+
check-toml: install-taplo-cli
55+
taplo check
56+
57+
check: check-fmt check-clippy check-cargo-sort check-toml cargo-machete
58+
59+
doc-test:
60+
cargo test --no-fail-fast --doc --all-features --workspace
61+
62+
unit-test: doc-test
63+
cargo test --no-fail-fast --lib --all-features --workspace
64+
65+
test: doc-test
66+
cargo test --no-fail-fast --all-targets --all-features --workspace
67+
68+
clean:
69+
cargo clean

clients/filesystem-fuse/build.gradle.kts

+16-20
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import org.gradle.api.tasks.Exec
2121

2222
val checkRustEnvironment by tasks.registering(Exec::class) {
23-
description = "Check if Rust environment."
24-
group = "verification"
2523
commandLine("bash", "-c", "cargo --version")
2624
standardOutput = System.out
2725
errorOutput = System.err
@@ -30,36 +28,30 @@ val checkRustEnvironment by tasks.registering(Exec::class) {
3028

3129
val buildRustProject by tasks.registering(Exec::class) {
3230
dependsOn(checkRustEnvironment)
33-
description = "Compile the Rust project"
3431
workingDir = file("$projectDir")
35-
commandLine("bash", "-c", "cargo build --release")
32+
commandLine("bash", "-c", "make build")
3633
}
3734

3835
val checkRustProject by tasks.registering(Exec::class) {
3936
dependsOn(checkRustEnvironment)
40-
description = "Check the Rust project"
4137
workingDir = file("$projectDir")
4238

43-
commandLine(
44-
"bash",
45-
"-c",
46-
"""
47-
set -e
48-
echo "Checking the code format"
49-
cargo fmt --all -- --check
50-
51-
echo "Running clippy"
52-
cargo clippy --all-targets --all-features --workspace -- -D warnings
53-
""".trimIndent()
54-
)
39+
commandLine("bash", "-c", "make check")
5540
}
5641

5742
val testRustProject by tasks.registering(Exec::class) {
5843
dependsOn(checkRustEnvironment)
59-
description = "Run tests in the Rust project"
60-
group = "verification"
6144
workingDir = file("$projectDir")
62-
commandLine("bash", "-c", "cargo test --release")
45+
commandLine("bash", "-c", "make test")
46+
47+
standardOutput = System.out
48+
errorOutput = System.err
49+
}
50+
51+
val cleanRustProject by tasks.registering(Exec::class) {
52+
dependsOn(checkRustEnvironment)
53+
workingDir = file("$projectDir")
54+
commandLine("bash", "-c", "make clean")
6355

6456
standardOutput = System.out
6557
errorOutput = System.err
@@ -85,3 +77,7 @@ tasks.named("check") {
8577
tasks.named("test") {
8678
dependsOn(testRustProject)
8779
}
80+
81+
tasks.named("clean") {
82+
dependsOn(cleanRustProject)
83+
}

0 commit comments

Comments
 (0)