5
5
import org .cryptomator .jfuse .api .FuseMount ;
6
6
import org .cryptomator .jfuse .api .FuseMountFailedException ;
7
7
import org .cryptomator .jfuse .api .FuseOperations ;
8
+ import org .cryptomator .jfuse .api .util .MemoryUtils ;
8
9
import org .cryptomator .jfuse .linux .aarch64 .extr .fuse3 .fuse_args ;
9
10
import org .cryptomator .jfuse .linux .aarch64 .extr .fuse3 .fuse_h ;
10
11
import org .cryptomator .jfuse .linux .aarch64 .extr .fuse3 .fuse_operations ;
@@ -116,14 +117,14 @@ private int access(MemorySegment path, int mask) {
116
117
117
118
private int chmod (MemorySegment path , int mode , MemorySegment fi ) {
118
119
try (var arena = Arena .ofConfined ()) {
119
- return fuseOperations .chmod (path .getUtf8String (0 ), mode , new FileInfoImpl (fi , arena ));
120
+ return fuseOperations .chmod (path .getUtf8String (0 ), mode , FileInfoImpl . of (fi , arena ));
120
121
}
121
122
}
122
123
123
124
@ VisibleForTesting
124
125
int chown (MemorySegment path , int uid , int gid , MemorySegment fi ) {
125
126
try (var arena = Arena .ofConfined ()) {
126
- return fuseOperations .chown (path .getUtf8String (0 ), uid , gid , new FileInfoImpl (fi , arena ));
127
+ return fuseOperations .chown (path .getUtf8String (0 ), uid , gid , FileInfoImpl . of (fi , arena ));
127
128
}
128
129
}
129
130
@@ -154,13 +155,13 @@ int fsync(MemorySegment path, int datasync, MemorySegment fi) {
154
155
@ VisibleForTesting
155
156
int fsyncdir (MemorySegment path , int datasync , MemorySegment fi ) {
156
157
try (var arena = Arena .ofConfined ()) {
157
- return fuseOperations .fsyncdir (path . getUtf8String ( 0 ), datasync , new FileInfoImpl (fi , arena ));
158
+ return fuseOperations .fsyncdir (MemoryUtils . toUtf8StringOrNull ( path ), datasync , new FileInfoImpl (fi , arena ));
158
159
}
159
160
}
160
161
161
162
private int getattr (MemorySegment path , MemorySegment stat , MemorySegment fi ) {
162
163
try (var arena = Arena .ofConfined ()) {
163
- return fuseOperations .getattr (path .getUtf8String (0 ), new StatImpl (stat , arena ), new FileInfoImpl (fi , arena ));
164
+ return fuseOperations .getattr (path .getUtf8String (0 ), new StatImpl (stat , arena ), FileInfoImpl . of (fi , arena ));
164
165
}
165
166
}
166
167
@@ -229,7 +230,7 @@ private int release(MemorySegment path, MemorySegment fi) {
229
230
230
231
private int releasedir (MemorySegment path , MemorySegment fi ) {
231
232
try (var arena = Arena .ofConfined ()) {
232
- return fuseOperations .releasedir (path . getUtf8String ( 0 ), new FileInfoImpl (fi , arena ));
233
+ return fuseOperations .releasedir (MemoryUtils . toUtf8StringOrNull ( path ), new FileInfoImpl (fi , arena ));
233
234
}
234
235
}
235
236
@@ -253,7 +254,7 @@ private int symlink(MemorySegment linkname, MemorySegment target) {
253
254
254
255
private int truncate (MemorySegment path , long size , MemorySegment fi ) {
255
256
try (var arena = Arena .ofConfined ()) {
256
- return fuseOperations .truncate (path .getUtf8String (0 ), size , new FileInfoImpl (fi , arena ));
257
+ return fuseOperations .truncate (path .getUtf8String (0 ), size , FileInfoImpl . of (fi , arena ));
257
258
}
258
259
}
259
260
@@ -271,11 +272,11 @@ int utimens(MemorySegment path, MemorySegment times, MemorySegment fi) {
271
272
timespec .tv_sec$set (segment , 0 );
272
273
timespec .tv_nsec$set (segment , stat_h .UTIME_NOW ());
273
274
var time = new TimeSpecImpl (segment );
274
- return fuseOperations .utimens (path .getUtf8String (0 ), time , time , new FileInfoImpl (fi , arena ));
275
+ return fuseOperations .utimens (path .getUtf8String (0 ), time , time , FileInfoImpl . of (fi , arena ));
275
276
} else {
276
277
var time0 = times .asSlice (0 , timespec .$LAYOUT ().byteSize ());
277
278
var time1 = times .asSlice (timespec .$LAYOUT ().byteSize (), timespec .$LAYOUT ().byteSize ());
278
- return fuseOperations .utimens (path .getUtf8String (0 ), new TimeSpecImpl (time0 ), new TimeSpecImpl (time1 ), new FileInfoImpl (fi , arena ));
279
+ return fuseOperations .utimens (path .getUtf8String (0 ), new TimeSpecImpl (time0 ), new TimeSpecImpl (time1 ), FileInfoImpl . of (fi , arena ));
279
280
}
280
281
}
281
282
}
0 commit comments