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:
@@ -78,6 +78,9 @@ func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenR
|
||||
if entry := handle.Node().DirEntry(); entry != nil && entry.Size() < 0 {
|
||||
resp.Flags |= fuse.OpenDirectIO
|
||||
}
|
||||
if f.fsys.opt.DirectIO {
|
||||
resp.Flags |= fuse.OpenDirectIO
|
||||
}
|
||||
|
||||
return &FileHandle{handle}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user