Skip to content

Commit

Permalink
Fixes #31
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Apr 6, 2023
1 parent d9f6f5d commit c5851bb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
4 changes: 2 additions & 2 deletions jfuse-win/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<headerClassName>fuse_h</headerClassName>
<cPreprocessorMacros>
<cPreprocessorMacro>WINFSP_DLL_INTERNAL</cPreprocessorMacro>
<cPreprocessorMacro>FUSE_USE_VERSION=33</cPreprocessorMacro>
<cPreprocessorMacro>FUSE_USE_VERSION=31</cPreprocessorMacro>
<cPreprocessorMacro>CYGFUSE</cPreprocessorMacro>
</cPreprocessorMacros>
<includeFunctions>
Expand All @@ -98,7 +98,7 @@
<includeFunction>fuse3_mount</includeFunction>
<includeFunction>fuse3_get_session</includeFunction>
<includeFunction>fuse3_loop</includeFunction>
<includeFunction>fuse3_loop_mt</includeFunction>
<includeFunction>fuse3_loop_mt_31</includeFunction>
<includeFunction>fuse3_exit</includeFunction>
<includeFunction>fuse3_unmount</includeFunction>
<includeFunction>fuse3_destroy</includeFunction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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$);
}
Expand Down

0 comments on commit c5851bb

Please sign in to comment.