-
-
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
19 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 5533a97
Merge branch 'develop' into feature/capable-ext
infeo 3a06885
code cleanup
infeo c1db90b
add tests for fuseConfInfoImpl317
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
45 changes: 45 additions & 0 deletions
45
...-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,45 @@ | ||
| 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() { | ||
| //old school style | ||
| //return segment.get(fuse_conn_info.capable_ext$layout().withByteAlignment(1), fuse_conn_info.capable_ext$offset()); | ||
| 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("capable()", (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.