Skip to content

Commit

Permalink
feat: add macos sync io
Browse files Browse the repository at this point in the history
  • Loading branch information
akitaSummer committed Jan 12, 2024
1 parent 4299e69 commit 2b3daf5
Show file tree
Hide file tree
Showing 8 changed files with 356 additions and 257 deletions.
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ pub type Result<T> = ::std::result::Result<T, Error>;
pub mod abi;
pub mod api;

// #[cfg(all(any(feature = "fusedev", feature = "virtiofs"), target_os = "linux"))]
#[cfg(all(
any(feature = "fusedev", feature = "virtiofs"),
any(target_os = "macos", target_os = "linux")
))]
pub mod passthrough;
pub mod transport;

Expand Down
197 changes: 0 additions & 197 deletions src/passthrough/macos_sync_io.rs

This file was deleted.

15 changes: 11 additions & 4 deletions src/passthrough/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,14 @@ mod config;
mod file_handle;
mod inode_store;
#[cfg(target_os = "linux")]
mod linux_sync_io;
#[cfg(target_os = "macos")]
mod macos_sync_io;
#[cfg(target_os = "linux")]
mod mount_fd;
#[cfg(target_os = "linux")]
mod os_compat;
#[cfg(target_os = "macos")]
mod stat;
#[cfg(target_os = "linux")]
mod statx;
mod sync_io;
mod util;

type Inode = u64;
Expand All @@ -89,6 +86,16 @@ type LibCStat = libc::stat64;
#[cfg(target_os = "macos")]
type LibCStat = libc::stat;

#[cfg(target_os = "linux")]
type OffT = libc::off64_t;
#[cfg(target_os = "macos")]
type OffT = libc::off_t;

#[cfg(target_os = "linux")]
type StatVfs = libc::statvfs64;
#[cfg(target_os = "macos")]
type StatVfs = libc::statvfs;

/// Maximum host inode number supported by passthroughfs
const MAX_HOST_INO: u64 = 0x7fff_ffff_ffff;

Expand Down
Loading

0 comments on commit 2b3daf5

Please sign in to comment.