mirror of
https://github.com/rclone/rclone.git
synced 2026-01-06 18:43:50 +00:00
mount,cmount,mount2: add --direct-io flag to force uncached access
This change adds the --direct-io flag to the mount. This means the page cache is completely bypassed for reads and writes. No read-ahead takes place. Shared mmap is disabled. This is useful to accurately read files which may change length frequently on the source.
This commit is contained in:
@@ -158,6 +158,9 @@ func (n *Node) Open(ctx context.Context, flags uint32) (fh fusefs.FileHandle, fu
|
||||
if entry := n.node.DirEntry(); entry != nil && entry.Size() < 0 {
|
||||
fuseFlags |= fuse.FOPEN_DIRECT_IO
|
||||
}
|
||||
if n.fsys.opt.DirectIO {
|
||||
fuseFlags |= fuse.FOPEN_DIRECT_IO
|
||||
}
|
||||
return newFileHandle(handle, n.fsys), fuseFlags, 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user