-
-
Notifications
You must be signed in to change notification settings - Fork 5
Feature: Implement fields capable_ext and want_ext #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
infeo
wants to merge
16
commits into
develop
Choose a base branch
from
feature/capable-ext
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c04d668
Introduce capable_ext/want_ext fields
infeo fad20d7
add "custom" javadoc tag to maven config
infeo 2f057fe
improve API docs
infeo 545d432
extend test
infeo 71dbfa4
add more semi offical javadoc tags
infeo a0f9c4c
Fix wrong beginning of try statement in FuseFunctions
infeo aed1dd2
Adjust API
infeo 3912140
check fuse version instead of probing
infeo 4fecb5f
prevent jvm crashes when using trying to access want_ext for libfuse …
infeo b63962b
fix wrong FunctionDescriptor
infeo 309ebf6
use correct version information
infeo 3728833
implement feature also for linux aarch64
infeo a51bbf3
revert 545d432367e558efaff2e7ce4f79870a2a7b055a
infeo f362408
add missing unit tests
infeo 5fe0be7
Fix wrong function descriptors
infeo 7327efd
minor review findings
infeo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseConnInfoImpl317.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package org.cryptomator.jfuse.linux.aarch64; | ||
|
|
||
| import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_conn_info; | ||
|
|
||
| import java.lang.foreign.MemorySegment; | ||
|
|
||
| class FuseConnInfoImpl317 extends FuseConnInfoImpl { | ||
|
|
||
| FuseConnInfoImpl317(MemorySegment segment) { | ||
| super(segment); | ||
| } | ||
|
|
||
| @Override | ||
| public long capableExt() { | ||
| return fuse_conn_info.capable_ext(segment); | ||
| } | ||
|
|
||
| @Override | ||
| public long wantExt() { | ||
| return fuse_conn_info.want_ext(segment); | ||
| } | ||
|
|
||
| @Override | ||
| public void setWantExt(long wantExt) { | ||
| fuse_conn_info.want_ext(segment, wantExt); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean setFeatureFlag(long flag) { | ||
| return FuseFunctions.fuse_set_feature_flag(segment, flag); | ||
| } | ||
|
|
||
| @Override | ||
| public void unsetFeatureFlag(long flag) { | ||
| FuseFunctions.fuse_unset_feature_flag(segment, flag); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean getFeatureFlag(long flag) { | ||
| return FuseFunctions.fuse_get_feature_flag(segment, flag); | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...ux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseConnInfoImpl317Test.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| package org.cryptomator.jfuse.linux.aarch64; | ||
|
|
||
| import org.cryptomator.jfuse.api.FuseConnInfo; | ||
| import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_conn_info; | ||
| import org.junit.jupiter.api.Assertions; | ||
| import org.junit.jupiter.api.DisplayName; | ||
| import org.junit.jupiter.api.Named; | ||
| import org.junit.jupiter.params.ParameterizedTest; | ||
| import org.junit.jupiter.params.provider.Arguments; | ||
| import org.junit.jupiter.params.provider.MethodSource; | ||
|
|
||
| import java.lang.foreign.Arena; | ||
| import java.lang.foreign.MemorySegment; | ||
| import java.util.function.BiConsumer; | ||
| import java.util.function.Function; | ||
| import java.util.stream.Stream; | ||
|
|
||
| public class FuseConnInfoImpl317Test { | ||
|
|
||
| @DisplayName("test long getters") | ||
| @ParameterizedTest(name = "{1}") | ||
| @MethodSource | ||
| void testGetters(SetInMemorySegment setter, GetInConnInfo getter) { | ||
| try (var arena = Arena.ofConfined()) { | ||
| var segment = fuse_conn_info.allocate(arena); | ||
| var connInfo = new FuseConnInfoImpl317(segment); | ||
|
|
||
| setter.accept(segment, 42L); | ||
|
|
||
| Assertions.assertEquals(42L, getter.apply(connInfo)); | ||
| } | ||
| } | ||
|
|
||
| public static Stream<Arguments> testGetters() { | ||
| return Stream.of( | ||
| Arguments.arguments((SetInMemorySegment) fuse_conn_info::want_ext, Named.of("wantExt()", (GetInConnInfo) FuseConnInfo::wantExt)), | ||
| Arguments.arguments((SetInMemorySegment) fuse_conn_info::capable_ext, Named.of("capableExt()", (GetInConnInfo) FuseConnInfo::capableExt)) | ||
| ); | ||
| } | ||
|
|
||
| interface SetInMemorySegment extends BiConsumer<MemorySegment, Long> { | ||
| } | ||
|
|
||
| interface GetInConnInfo extends Function<FuseConnInfo, Long> { | ||
| } | ||
|
|
||
| @DisplayName("test setters") | ||
| @ParameterizedTest(name = "{0}") | ||
| @MethodSource | ||
| void testSetters(SetInConnInfo setter, GetInMemorySegment getter) { | ||
| try (var arena = Arena.ofConfined()) { | ||
| var segment = fuse_conn_info.allocate(arena); | ||
| var connInfo = new FuseConnInfoImpl317(segment); | ||
|
|
||
| setter.accept(connInfo, 42L); | ||
|
|
||
| Assertions.assertEquals(42L, getter.apply(segment)); | ||
| } | ||
| } | ||
|
|
||
| public static Stream<Arguments> testSetters() { | ||
| return Stream.of( | ||
| Arguments.arguments(Named.of("setWantExt()", (SetInConnInfo) FuseConnInfo::setWantExt), (GetInMemorySegment) fuse_conn_info::want_ext) | ||
| ); | ||
| } | ||
|
|
||
| interface SetInConnInfo extends BiConsumer<FuseConnInfo, Long> { | ||
| } | ||
|
|
||
| interface GetInMemorySegment extends Function<MemorySegment, Long> { | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.