Skip to content

Commit

Permalink
Update fuser to v0.15.0 (awslabs#1088)
Browse files Browse the repository at this point in the history
## Description of change

Update fuser to the latest release,
[v0.15.0](https://github.com/cberner/fuser/releases/tag/v0.15.0).

---

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and I agree to the terms of
the [Developer Certificate of Origin
(DCO)](https://developercertificate.org/).

---------

Signed-off-by: Alessandro Passaro <[email protected]>
  • Loading branch information
passaro authored Oct 29, 2024
1 parent 856c31d commit ce54739
Show file tree
Hide file tree
Showing 32 changed files with 587 additions and 245 deletions.
76 changes: 43 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mountpoint-s3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publish = false
default-run = "mount-s3"

[dependencies]
fuser = { path = "../vendor/fuser", version = "0.14.0", features = ["abi-7-28"] }
fuser = { path = "../vendor/fuser", version = "0.15.0", features = ["abi-7-28"] }
mountpoint-s3-client = { path = "../mountpoint-s3-client", version = "0.11.0" }
mountpoint-s3-crt = { path = "../mountpoint-s3-crt", version = "0.10.0" }

Expand Down
16 changes: 10 additions & 6 deletions mountpoint-s3/examples/fs_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use mountpoint_s3_crt::common::rust_log_adapter::RustLogAdapter;
use std::{
fs::{File, OpenOptions},
io::{self, BufRead, BufReader},
path::Path,
time::Instant,
};
use tempfile::tempdir;
Expand Down Expand Up @@ -83,8 +84,9 @@ fn main() -> io::Result<()> {
.map(|s| s.parse::<usize>().expect("iterations must be a number"));
let region = matches.get_one::<String>("region").unwrap();

let session = mount_file_system(bucket_name, region, throughput_target_gbps);
let mountpoint = &session.mountpoint;
let temp_dir = tempdir().expect("Should be able to create temp directory");
let mountpoint = temp_dir.path();
let session = mount_file_system(mountpoint, bucket_name, region, throughput_target_gbps);

#[cfg(not(target_os = "linux"))]
if direct {
Expand Down Expand Up @@ -143,10 +145,12 @@ fn main() -> io::Result<()> {
Ok(())
}

fn mount_file_system(bucket_name: &str, region: &str, throughput_target_gbps: Option<f64>) -> BackgroundSession {
let temp_dir = tempdir().expect("Should be able to create temp directory");
let mountpoint = temp_dir.path();

fn mount_file_system(
mountpoint: &Path,
bucket_name: &str,
region: &str,
throughput_target_gbps: Option<f64>,
) -> BackgroundSession {
let mut config = S3ClientConfig::new().endpoint_config(EndpointConfig::new(region));
if let Some(throughput_target_gbps) = throughput_target_gbps {
config = config.throughput_target_gbps(throughput_target_gbps);
Expand Down
2 changes: 1 addition & 1 deletion mountpoint-s3/src/fuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ where
}

#[instrument(level="warn", skip_all, fields(req=_req.unique(), ino=ino, name=field::Empty))]
fn getattr(&self, _req: &Request<'_>, ino: InodeNo, reply: ReplyAttr) {
fn getattr(&self, _req: &Request<'_>, ino: InodeNo, _fh: Option<u64>, reply: ReplyAttr) {
match block_on(self.fs.getattr(ino).in_current_span()) {
Ok(attr) => reply.attr(&attr.ttl, &attr.attr),
Err(e) => fuse_error!("getattr", reply, e),
Expand Down
4 changes: 2 additions & 2 deletions vendor/fuser/.cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
freebsd_instance:
image_family: freebsd-12-2
image_family: freebsd-14-0

task:
name: FreeBSD 12.2
name: FreeBSD
setup_script:
- pkg install -y pkgconf fusefs-libs fusefs-libs3 rust
build_script:
Expand Down
50 changes: 22 additions & 28 deletions vendor/fuser/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,28 @@ name: CI

on:
pull_request:
push: # required for actions/cache to work
branches:
- master

jobs:
compile:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
libfuse: [libfuse-dev, libfuse3-dev]
features: [ '', 'abi-7-19' ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install packages
run: |
sudo apt update
sudo apt install -y ${{ matrix.libfuse }} build-essential
- uses: actions-rs/toolchain@v1
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: x86_64-unknown-linux-musl
default: true

- name: Run tests
run: |
Expand All @@ -31,41 +33,33 @@ jobs:
cargo test --all --features=${{ matrix.features }}
cargo doc --all --no-deps --features=${{ matrix.features }}
ci:
runs-on: ubuntu-20.04
strategy:
matrix:
test_group: [pre, mount_tests, pjdfs_tests, xfstests]

runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install packages
run: |
sudo apt update
sudo apt install -y libfuse-dev libfuse3-dev build-essential
- uses: actions-rs/toolchain@v1
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
default: true

- name: Cache cargo registry
uses: actions/cache@v1
- uses: taiki-e/install-action@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
tool: [email protected]

- name: Install cargo-deny
run: cargo install --force --version 0.12.2 cargo-deny --locked
- name: Run tests
run: INTERACTIVE="" make pre

test:
runs-on: ubuntu-22.04
strategy:
matrix:
test_group: [mount_tests, pjdfs_tests, xfstests]

steps:
- uses: actions/checkout@v4

- name: Run tests
run: INTERACTIVE="" make ${{ matrix.test_group }}
7 changes: 7 additions & 0 deletions vendor/fuser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# FUSE for Rust - Changelog

## 0.15.0 - 2024-10-25
* Add file handle argument to `getattr()`
* Change `poll()` to take a `PollHandle` instead of a `u64`
* Add low level API for manually mounting or wrapping a fuse file descriptor into a `Session`
* Fix compatibility with MacFUSE 4.x
* Performance optimizations

## 0.14.0 - 2023-11-04
* Add support for poll
* Add support for notifications
Expand Down
29 changes: 16 additions & 13 deletions vendor/fuser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
[package]
name = "fuser"
edition = "2018"
version = "0.14.0"
authors = ["Christopher Berner <[email protected]>"]
description = "Filesystem in Userspace (FUSE) for Rust"
license = "MIT"
repository = "https://github.com/cberner/fuser"
documentation = "https://docs.rs/fuser"
homepage = "https://github.com/cberner/fuser"
repository = "https://github.com/cberner/fuser"
version = "0.15.0"
edition = "2021"
readme = "README.md"
authors = ["Christopher Berner <[email protected]>"]
keywords = ["fuse", "filesystem", "system", "bindings"]
categories = ["external-ffi-bindings", "api-bindings", "filesystem", "os::unix-apis"]
build = "build.rs"
license = "MIT"

[badges]
travis-ci = { repository = "cberner/fuser" }

[dependencies]
libc = "0.2.51"
log = "0.4.6"
memchr = "2"
memchr = "2.7.2"
page_size = "0.6.0"
serde = { version = "1.0.102", features = ["std", "derive"], optional = true }
smallvec = "1.6.1"
zerocopy = { version = "0.7", features = ["derive"] }
zerocopy = { version = "0.8", features = ["derive"] }
nix = { version = "0.29.0", features = ["fs", "user"] }

[dev-dependencies]
env_logger = "0.10"
env_logger = "0.11.3"
clap = { version = "4.4", features = ["cargo", "derive"] }
bincode = "1.3.1"
serde = { version = "1.0.102", features = ["std", "derive"] }
tempfile = "3"
nix = { version = "0.27.1", features = ["poll", "fs"] }
tempfile = "3.10.1"
nix = { version = "0.29.0", features = ["poll", "fs", "ioctl"] }

[build-dependencies]
pkg-config = { version = "0.3.14", optional = true }
Expand All @@ -40,6 +38,7 @@ pkg-config = { version = "0.3.14", optional = true }
default = ["libfuse"]
libfuse = ["pkg-config"]
serializable = ["serde"]
macfuse-4-compat = []
abi-7-9 = []
abi-7-10 = ["abi-7-9"]
abi-7-11 = ["abi-7-10"]
Expand Down Expand Up @@ -79,3 +78,7 @@ required-features = ["abi-7-12"]
[[example]]
name = "notify_inval_inode"
required-features = ["abi-7-12"]

[[example]]
name = "ioctl"
required-features = ["abi-7-11"]
Loading

0 comments on commit ce54739

Please sign in to comment.