perf: use performance-enhancing FUSE mount options

This commit is contained in:
Max 2021-08-26 23:13:51 +02:00 committed by Adin Schmahmann
parent 74633ca8a9
commit 7b160fbb76

View File

@ -33,12 +33,16 @@ func NewMount(p goprocess.Process, fsys fs.FS, mountpoint string, allow_other bo
var conn *fuse.Conn
var err error
if allow_other {
conn, err = fuse.Mount(mountpoint, fuse.AllowOther())
} else {
conn, err = fuse.Mount(mountpoint)
var mountOpts = []fuse.MountOption{
fuse.MaxReadahead(64 * 1024 * 1024),
fuse.AsyncRead(),
}
if allow_other {
mountOpts = append(mountOpts, fuse.AllowOther())
}
conn, err = fuse.Mount(mountpoint, mountOpts...)
if err != nil {
return nil, err
}