mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 18:37:45 +08:00
perf: use performance-enhancing FUSE mount options
This commit is contained in:
parent
74633ca8a9
commit
7b160fbb76
@ -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
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user