vfs: stop virtual directory entries dropping out of the directory cache
Rclone adds virtual directory entries to the directory cache when it creates a file or directory. Before this change these dropped out of the directory cache when the directory cache was reloaded. This meant that when the directory cache expired: - On bucket based backends, empty directories would disappear - When using VFS writeback, files in the process of uploading would disappear This is fixed by keeping track of the virtual entries in each directory. The virtual entries are removed when they become real - ie the object is read back from the listing. This also keeps tracks of deletes in the same way so if a file is deleted, it will not re-appear when the directory cache is reloaded if the deletion hasn't finished yet.
This commit is contained in:
parent
143abe39f2
commit
06a12f5e27
3 changed files with 176 additions and 8 deletions
25
vfs/vstate_string.go
Normal file
25
vfs/vstate_string.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Code generated by "stringer -type=vState"; DO NOT EDIT.
|
||||
|
||||
package vfs
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[vOK-0]
|
||||
_ = x[vAdd-1]
|
||||
_ = x[vDel-2]
|
||||
}
|
||||
|
||||
const _vState_name = "vOKvAddvDel"
|
||||
|
||||
var _vState_index = [...]uint8{0, 3, 7, 11}
|
||||
|
||||
func (i vState) String() string {
|
||||
if i >= vState(len(_vState_index)-1) {
|
||||
return "vState(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _vState_name[_vState_index[i]:_vState_index[i+1]]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue