From c5851bb36b082233a8ba7196ea8fdc555ef7b08f Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 6 Apr 2023 10:35:27 +0200 Subject: [PATCH 1/2] Fixes #31 --- jfuse-win/pom.xml | 4 ++-- .../org/cryptomator/jfuse/win/FuseMountImpl.java | 8 ++------ .../org/cryptomator/jfuse/win/extr/constants$1.java | 10 +++++----- .../java/org/cryptomator/jfuse/win/extr/fuse_h.java | 12 ++++++------ 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/jfuse-win/pom.xml b/jfuse-win/pom.xml index 6da804de..44569e09 100644 --- a/jfuse-win/pom.xml +++ b/jfuse-win/pom.xml @@ -89,7 +89,7 @@ fuse_h WINFSP_DLL_INTERNAL - FUSE_USE_VERSION=33 + FUSE_USE_VERSION=31 CYGFUSE @@ -98,7 +98,7 @@ fuse3_mount fuse3_get_session fuse3_loop - fuse3_loop_mt + fuse3_loop_mt_31 fuse3_exit fuse3_unmount fuse3_destroy diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseMountImpl.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseMountImpl.java index ee31d3be..565c6216 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseMountImpl.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseMountImpl.java @@ -12,12 +12,8 @@ record FuseMountImpl(MemorySegment fuse, FuseArgs fuseArgs) implements FuseMount @Override public int loop() { if (fuseArgs.multiThreaded()) { - try (var arena = Arena.openConfined()) { - var loopCfg = fuse3_loop_config.allocate(arena); - fuse3_loop_config.clone_fd$set(loopCfg,0); - fuse3_loop_config.max_idle_threads$set(loopCfg, 5); - return fuse_h.fuse3_loop_mt(fuse, loopCfg); - } + //We cannot use fuse3_loop_mt(fuse, fuseconfig) due to https://github.com/cryptomator/jfuse/issues/31 + return fuse_h.fuse3_loop_mt_31(fuse, 0); } else { return fuse_h.fuse3_loop(fuse); } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/constants$1.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/constants$1.java index e82479dd..04ca74e9 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/constants$1.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/constants$1.java @@ -25,13 +25,13 @@ final class constants$1 { "fuse3_loop", constants$1.fuse3_loop$FUNC ); - static final FunctionDescriptor fuse3_loop_mt$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + static final FunctionDescriptor fuse3_loop_mt_31$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT + Constants$root.C_LONG$LAYOUT ); - static final MethodHandle fuse3_loop_mt$MH = RuntimeHelper.downcallHandle( - "fuse3_loop_mt", - constants$1.fuse3_loop_mt$FUNC + static final MethodHandle fuse3_loop_mt_31$MH = RuntimeHelper.downcallHandle( + "fuse3_loop_mt_31", + constants$1.fuse3_loop_mt_31$FUNC ); static final FunctionDescriptor fuse3_exit$FUNC = FunctionDescriptor.ofVoid( Constants$root.C_POINTER$LAYOUT diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_h.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_h.java index f6118b92..9c6a494f 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_h.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_h.java @@ -113,18 +113,18 @@ public static int fuse3_loop(MemorySegment f) { throw new AssertionError("should not reach here", ex$); } } - public static MethodHandle fuse3_loop_mt$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse3_loop_mt$MH,"fuse3_loop_mt"); + public static MethodHandle fuse3_loop_mt_31$MH() { + return RuntimeHelper.requireNonNull(constants$1.fuse3_loop_mt_31$MH,"fuse3_loop_mt_31"); } /** * {@snippet : - * int fuse3_loop_mt(struct fuse3* f, struct fuse3_loop_config* config); + * int fuse3_loop_mt_31(struct fuse3* f, int clone_fd); * } */ - public static int fuse3_loop_mt(MemorySegment f, MemorySegment config) { - var mh$ = fuse3_loop_mt$MH(); + public static int fuse3_loop_mt_31(MemorySegment f, int clone_fd) { + var mh$ = fuse3_loop_mt_31$MH(); try { - return (int)mh$.invokeExact(f, config); + return (int)mh$.invokeExact(f, clone_fd); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } From 373e8fbe5b1be534e74e6e650b930249a6d49782 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 6 Apr 2023 10:40:29 +0200 Subject: [PATCH 2/2] prepare 0.5.1 --- jfuse-api/pom.xml | 2 +- jfuse-examples/pom.xml | 2 +- jfuse-linux-aarch64/pom.xml | 2 +- jfuse-linux-amd64/pom.xml | 2 +- jfuse-mac/pom.xml | 2 +- jfuse-tests/pom.xml | 2 +- jfuse-win/pom.xml | 2 +- jfuse/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/jfuse-api/pom.xml b/jfuse-api/pom.xml index d47b1f55..624eb7f5 100644 --- a/jfuse-api/pom.xml +++ b/jfuse-api/pom.xml @@ -5,7 +5,7 @@ org.cryptomator jfuse-parent - 0.6.0-SNAPSHOT + 0.5.1 4.0.0 jfuse-api diff --git a/jfuse-examples/pom.xml b/jfuse-examples/pom.xml index 1679f3ff..f73183a2 100644 --- a/jfuse-examples/pom.xml +++ b/jfuse-examples/pom.xml @@ -5,7 +5,7 @@ org.cryptomator jfuse-parent - 0.6.0-SNAPSHOT + 0.5.1 4.0.0 jfuse-examples diff --git a/jfuse-linux-aarch64/pom.xml b/jfuse-linux-aarch64/pom.xml index 77026f1e..a174b7b5 100644 --- a/jfuse-linux-aarch64/pom.xml +++ b/jfuse-linux-aarch64/pom.xml @@ -5,7 +5,7 @@ jfuse-parent org.cryptomator - 0.6.0-SNAPSHOT + 0.5.1 4.0.0 jfuse-linux-aarch64 diff --git a/jfuse-linux-amd64/pom.xml b/jfuse-linux-amd64/pom.xml index eb60aaa2..b4168ae5 100644 --- a/jfuse-linux-amd64/pom.xml +++ b/jfuse-linux-amd64/pom.xml @@ -5,7 +5,7 @@ org.cryptomator jfuse-parent - 0.6.0-SNAPSHOT + 0.5.1 4.0.0 jfuse-linux-amd64 diff --git a/jfuse-mac/pom.xml b/jfuse-mac/pom.xml index b6f94808..da8ea343 100644 --- a/jfuse-mac/pom.xml +++ b/jfuse-mac/pom.xml @@ -5,7 +5,7 @@ org.cryptomator jfuse-parent - 0.6.0-SNAPSHOT + 0.5.1 4.0.0 jfuse-mac diff --git a/jfuse-tests/pom.xml b/jfuse-tests/pom.xml index 528f392d..e863069c 100644 --- a/jfuse-tests/pom.xml +++ b/jfuse-tests/pom.xml @@ -5,7 +5,7 @@ org.cryptomator jfuse-parent - 0.6.0-SNAPSHOT + 0.5.1 4.0.0 jfuse-tests diff --git a/jfuse-win/pom.xml b/jfuse-win/pom.xml index 44569e09..fff7c213 100644 --- a/jfuse-win/pom.xml +++ b/jfuse-win/pom.xml @@ -5,7 +5,7 @@ org.cryptomator jfuse-parent - 0.6.0-SNAPSHOT + 0.5.1 4.0.0 jfuse-win diff --git a/jfuse/pom.xml b/jfuse/pom.xml index 5819ae92..c9d1eb18 100644 --- a/jfuse/pom.xml +++ b/jfuse/pom.xml @@ -5,7 +5,7 @@ org.cryptomator jfuse-parent - 0.6.0-SNAPSHOT + 0.5.1 4.0.0 jfuse diff --git a/pom.xml b/pom.xml index 1bfd2b60..ade91e53 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.cryptomator jfuse-parent pom - 0.6.0-SNAPSHOT + 0.5.1 jFUSE Java bindings for FUSE using foreign functions & memory API https://github.com/cryptomator/jfuse