Skip to content

Commit

Permalink
Fix capabilities issues with macFuse
Browse files Browse the repository at this point in the history
  • Loading branch information
FirelightFlagboy committed Oct 31, 2024
1 parent bae3e7c commit 504cf78
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions libparsec/crates/platform_mountpoint/src/unix/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,29 +261,33 @@ impl fuser::Filesystem for Filesystem {
config,
// Do not send separate SETATTR request before open(O_TRUNC).
// See https://github.com/libfuse/libfuse/blob/2aeef499b84b596608181f9b48d589c4f8ffe24a/include/fuse_common.h#L188
FUSE_ATOMIC_O_TRUNC,
// Support IOCTL on directories.
// See https://github.com/libfuse/libfuse/blob/2aeef499b84b596608181f9b48d589c4f8ffe24a/include/fuse_common.h#L253
FUSE_IOCTL_DIR,
// Tell FUSE the data may change without going through the filesystem, hence attributes
// validity should be checked on each access (leading to `getattr()` on timeout).
// See https://github.com/libfuse/libfuse/blob/2aeef499b84b596608181f9b48d589c4f8ffe24a/include/fuse_common.h#L275
FUSE_AUTO_INVAL_DATA,
// Enable `readdirplus` support (readdir + lookup in one a single go).
// See https://github.com/libfuse/libfuse/blob/2aeef499b84b596608181f9b48d589c4f8ffe24a/include/fuse_common.h#L283
FUSE_DO_READDIRPLUS,
// Adaptative readdirplus optimization support: still use readdir when lookup is
// has already been done by the previous readdirplus.
// See https://github.com/libfuse/libfuse/blob/2aeef499b84b596608181f9b48d589c4f8ffe24a/include/fuse_common.h#L311
FUSE_READDIRPLUS_AUTO,
// Allow parallel lookups and readdir on any given folder (default is serialized).
// See https://github.com/libfuse/libfuse/blob/2aeef499b84b596608181f9b48d589c4f8ffe24a/include/fuse_common.h#L354
FUSE_PARALLEL_DIROPS
FUSE_ATOMIC_O_TRUNC
);

// Fuser doesn't provided splice config on macOS
#[cfg(not(target_os = "macos"))]
{
// Capabilities not supported by MacFuse 4.8
add_capabilities!(
config,
// Support IOCTL on directories.
// See https://github.com/libfuse/libfuse/blob/2aeef499b84b596608181f9b48d589c4f8ffe24a/include/fuse_common.h#L253
FUSE_IOCTL_DIR,
// Tell FUSE the data may change without going through the filesystem, hence attributes
// validity should be checked on each access (leading to `getattr()` on timeout).
// See https://github.com/libfuse/libfuse/blob/2aeef499b84b596608181f9b48d589c4f8ffe24a/include/fuse_common.h#L275
FUSE_AUTO_INVAL_DATA,
// Enable `readdirplus` support (readdir + lookup in one a single go).
// See https://github.com/libfuse/libfuse/blob/2aeef499b84b596608181f9b48d589c4f8ffe24a/include/fuse_common.h#L283
FUSE_DO_READDIRPLUS,
// Adaptative readdirplus optimization support: still use readdir when lookup is
// has already been done by the previous readdirplus.
// See https://github.com/libfuse/libfuse/blob/2aeef499b84b596608181f9b48d589c4f8ffe24a/include/fuse_common.h#L311
FUSE_READDIRPLUS_AUTO,
// Allow parallel lookups and readdir on any given folder (default is serialized).
// See https://github.com/libfuse/libfuse/blob/2aeef499b84b596608181f9b48d589c4f8ffe24a/include/fuse_common.h#L354
FUSE_PARALLEL_DIROPS
);
// Fuser doesn't provided splice config on macOS
add_capabilities!(
config,
// TODO: `FUSE_SPLICE_READ` seems to require `write_buf()` to be implemented, which is
Expand Down

0 comments on commit 504cf78

Please sign in to comment.