mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
vfs: stop reading File members from outside file.go
This also fixes locking for ReadFileHandle and WriteFileHandle accessing File members
This commit is contained in:
@@ -607,6 +607,13 @@ func (f *File) VFS() *VFS {
|
||||
return f.d.vfs
|
||||
}
|
||||
|
||||
// Fs returns the underlying Fs for the file
|
||||
func (f *File) Fs() fs.Fs {
|
||||
f.mu.RLock()
|
||||
defer f.mu.RUnlock()
|
||||
return f.d.f
|
||||
}
|
||||
|
||||
// Open a file according to the flags provided
|
||||
//
|
||||
// O_RDONLY open the file read-only.
|
||||
|
||||
Reference in New Issue
Block a user