Commit Graph

1473 Commits (84920d11ddb7480758788f6cbb7718d96eda95ae)

Author SHA1 Message Date
Vitaliy Filippov 84920d11dd Add vectored read to readbenchfs
You can now run `./readbenchfs --mount_point dir --vectored` and then
`dd if=dir/test of=/dev/null iflag=direct bs=1M status=progress` to test
vectored read speed.

Results from my laptop (Linux 5.10):

1 core (GOMAXPROCS=1):
- Before vectored read patch: 2.1 GB/s
- Non-vectored read after vectored read patch: 2.1 GB/s
- Vectored read: 2.8 GB/s

All cores:
- Before vectored read patch: 3.0 GB/s
- Non-vectored read after vectored read patch: 3.3 GB/s
- Vectored read: 5.9 GB/s
2022-03-03 09:25:18 +01:00
Vitaliy Filippov c818f6216b Implement vectored read support
Read requests can now take vectored responses from the filesystem
implementation and send them to FUSE device via the writev() system call.

This allows file systems to send data without copying it into the
library-provided buffer if the data is already in memory.
2022-03-03 09:25:18 +01:00
Vitaliy Filippov da71c70600 Add ReadBenchFS to test linear read speed 2022-03-03 09:25:18 +01:00
Jakob Waibel c4197873da
Create mount_memfs sample (#121) 2022-02-14 20:12:19 +01:00
Vitaliy Filippov 108387eec1
Fix RenameOp compatibility with macfuse 4.x (#107)
Closed-source macfuse 4.x has broken compatibility with osxfuse 3.x:
it passes an additional 64-bit field (flags) after RenameIn regardless
that we don't enable the support for RENAME_SWAP/RENAME_EXCL.

The simplest fix is just to check for the presence of all-zero flags
and strip them when they're present.

Co-authored-by: Vitaliy Filippov <vitalif@yourcmc.ru>
2022-01-30 14:39:55 +01:00
Jakob Waibel 1b9b09fd17
feat: Remove duplicate code in test (#119) 2022-01-09 15:54:07 +01:00
Jakob Waibel ffd6c474e8
docs: add missing “kernel” (#117) 2021-11-25 17:36:55 +01:00
Tetsuo Kiso 7c4418392f
Add gofmt CI step (#115) 2021-11-08 15:02:43 +01:00
Tetsuo Kiso c0eeb00f17
Delete .travis.yml (#114) 2021-11-07 18:19:45 +01:00
Tetsuo Kiso 233e2c82a4
Disable go test in CI (#113) 2021-11-07 18:19:20 +01:00
Tetsuo Kiso a621cd4bb0
Switch from Travis CI to GitHub Actions (#111)
Fixes #99.
2021-11-07 17:30:55 +01:00
Oliver Le Zhuang 8da59ba998
InMessage is initialized with a storage allocated before reads (#110)
Fixes #109. In #102, the storage of the InMessage gets allocated every
time it's being read, which is expensive and caused issues like
https://github.com/GoogleCloudPlatform/gcsfuse/issues/563. So, this
change moves the allocation to its own function, called only once when
the struct is initialized before the reads.
2021-10-28 23:41:51 +02:00
Vitaliy Filippov c75d3f26fc
Use newer mounting method (similar to fusermount) with macfuse 4.x (#106)
macfuse 4.x turns out to be incompatible with the old mounting method where
you open the device by yourself and only supports the newer method where you
receive a file descriptor from `mount_macfuse` through a unix socket.

Co-authored-by: Vitaliy Filippov <vitalif@yourcmc.ru>
2021-10-19 18:50:09 +02:00
mcdhee-msft 95fc8d1181
Add configuration to control async reads (#105) 2021-09-04 17:48:39 +02:00
Vitaliy Filippov 10d864429b
Add support for MacFuse >= 4.0 (#103)
Older `osxfuse` is unavailable for ARM-based MacOS

Co-authored-by: Vitaliy Filippov <vitalif@yourcmc.ru>
2021-08-18 08:55:49 +02:00
Andrew Gaul 7782064498
Calculate pageSize and bufSize at run-time (#102)
ARM-based macOS uses 16 KB pages instead of 4 KB.  Fixes
GoogleCloudPlatform/gcsfuse#548.
2021-08-11 21:31:10 +02:00
Oliver Le Zhuang 5d146b000c
Add support for RenameOp to debug messages (#101) 2021-08-05 08:22:33 +02:00
Kurt Jensen d82237972e
Add support for max_pages and increase to 256 (#96)
* Bump protocol version to min 7.28, max 7.31
* Increase read/write buffer size to 1MiB
* Add new fields to initOp
* Set FUSE_MAX_PAGES flag for init
* Lower min minor version to 19 for osxfuse
* Fix linux WriteSize test
2021-08-02 23:29:12 +02:00
Michael Stapelberg 0630024b2b switch from assembly stubs to go:linkname comment
The go:linkname way works with Go 1.17 (with regabi), too.

Upstream did this in 2015 in
0b8d583320

See also https://sitano.github.io/2016/04/28/golang-private/ for more background
about both techniques.
2021-08-02 09:34:49 +02:00
Michael Stapelberg 8edaf5989f skip failing test for now 2021-08-02 09:27:30 +02:00
Vitaliy Filippov 9ad8359eec
Add handling of OpFsyncdir (#98)
Co-authored-by: Vitaliy Filippov <vitalif@yourcmc.ru>
2021-07-26 17:24:31 +02:00
Michael Stapelberg fac69e018f statfs sample: add missing locking 2021-06-06 20:54:41 +02:00
Michael Stapelberg e78223ecee Remove TestNonEmptyMountPoint; libfuse3 allows non-empty mountpoints
See also:
0bef21e854
2021-06-05 23:14:29 +02:00
Michael Stapelberg 7e446be212 fix memfs sample: use offset in fallocate call 2021-06-05 23:05:07 +02:00
Michael Stapelberg 6740b8faa5 travis: switch to Go 1.16 2021-06-05 22:53:39 +02:00
Michael Stapelberg 9c4c16288f declare a go module 2021-06-05 22:48:45 +02:00
Liri S 9677d03922
Added samples/roloopbackfs (#95) 2021-03-30 13:24:55 +02:00
Elliot Speck e0296dec95
Switch using Linux "default_permissions" to an optional parameter. (#94)
There's no reason for this to be enforced on the user. For use-cases such as S3-backing, there are no "permissions" of such to base this on. Consequently, everything ends up being owned as root and making it far more difficult to use.

It should, however, be optional.
2020-12-16 16:55:45 +01:00
Mei Gui 36e01f1b3a
Add pid in all fuse ops (#92)
Expose PID as metadata in CreateFile, OpenFile and FlushFile operations

This will help us with kahing/goofys#273

Co-authored-by: Sai Teja Suram <pratap130492@gmail.com>
Co-authored-by: Sai Teja Suram <pts@avah.dev>
2020-10-28 08:51:23 +01:00
Brendan McMillion f8927095af
Set max file/folder name length. (#87) 2020-07-06 09:59:50 +02:00
Luke Alonso 05606cde59 Don't log ERANGE for ListXattrOp.
ListXattrOp behaves similarly to GetXattrOp in that you have to
return ERANGE in order to indicate the size of the attribute list,
so logging errors isn't warranted.
2020-07-06 09:55:24 +02:00
Kane York ac0efb5a5a
posix_test: Reenable O_APPEND tests by using raw syscall (#88) 2020-07-05 10:42:22 +02:00
Brendan McMillion 9ed0e37421
Fix tests on MacOS. (#86) 2020-06-26 07:46:03 +02:00
Brendan McMillion 1ec76bd410
Add ARM support. (#85) 2020-06-26 07:45:43 +02:00
Michael Stapelberg 1d001802f7 add samples/mount_hello executable
This is a simple program to verify that the FUSE library itself works,
easier to run than the existing samples/mount with flushfs.
2020-04-23 21:11:18 +02:00
Michael Stapelberg b6e2754edf prefer fusermount3 (from FUSE 3), fall back to old fusermount
fixes #84
2020-04-23 21:10:43 +02:00
Ka-Hing Cheung ffe3eb03da
rw and ro were flipped (#80)
when user mount via fstab, we get '-o rw' implicitly, and under
directmount this _enabled_ MS_RDONLY, which is the opposite of what we
want

refs https://github.com/kahing/goofys/issues/483
2020-03-23 08:51:36 +01:00
kungf 7d791d27a2
make fstype be composed of "fuse" and subtype (#77)
fix #76
2020-03-11 09:51:26 +01:00
Michael Stapelberg 2f65426467 implement NoOpenSupport and NoOpendirSupport
See also:
7678ac5061
d7afaec0b5
d9a9ea94f7
2020-02-15 08:31:54 +01:00
Michael Stapelberg 7c2b569250 implement symlink caching 2020-02-15 08:04:53 +01:00
Michael Stapelberg ae5da07e4c
remove naked returns across the code base (#75)
fixes #73
2020-01-28 10:10:08 +01:00
Ka-Hing Cheung 4898d79241 plumb through Fd in setattr (#67)
this allows us to distinguish between truncate vs ftruncate
2019-12-11 09:49:03 +01:00
Ka-Hing Cheung e7bcad2083 fix getxattr and listxattr (#72)
previously, this will fail if /mnt/file doesn't have an xattr:

```
listxattr("/mnt/file", 0x7fe8b3686830, 256) = -1 EIO (Input/output error)
```

We should be returning the actual size only if the input size is
zero. Related issue is if the filesystem returns ERANGE, we should
propagate that error instead of returning the actual size.

Replaced go-xattr usage with x/sys/unix so we can test this.
2019-12-11 09:41:37 +01:00
Ka-Hing Cheung 4ee1cf7f62 add support for fallocate (#66)
* Fallocate support

* use fallocate wrapper that works on darwin
2019-10-26 10:15:00 +02:00
Michael Stapelberg 081e9f4bc7
Merge pull request #59 from stapelberg/mount
try mounting without fusermount(1) first
2019-09-23 17:54:23 +02:00
Michael Stapelberg 53aac50a1c open /dev/fuse in blocking mode so the runtime does not use a poller
/dev/fuse is not pollable. Go ≥ 1.13 starts reporting this on Read().
2019-09-19 08:50:12 +02:00
Michael Stapelberg b71377f287 try mounting without fusermount(1) first
This requires root privileges or the CAP_SYS_ADMIN capability, but allows
supporting -o suid.
2019-09-19 08:50:12 +02:00
Michael Stapelberg 659cc51b20
convertAttributes: set S_ISUD bit from os.FileMode’s os.ModeSetuid (#58) 2019-09-19 08:49:04 +02:00
Michael Stapelberg cd3c1bb470 flush_fs_test: match another error message 2019-09-18 16:27:50 +02:00
Michael Stapelberg 3c60dc478a .travis.yml: pin to macOS 10.12 2019-09-18 16:16:40 +02:00