lib/model: Add fsync of files and directories, option to disable (fixes #3711)

This commit is contained in:
Unrud
2016-11-21 18:09:29 +01:00
committed by Jakob Borg
parent 51e10e344d
commit 1574b7d834
8 changed files with 126 additions and 1 deletions

View File

@@ -26,7 +26,7 @@ import (
const (
OldestHandledVersion = 10
CurrentVersion = 16
CurrentVersion = 17
MaxRescanIntervalS = 365 * 24 * 60 * 60
)
@@ -254,6 +254,9 @@ func (cfg *Configuration) clean() error {
if cfg.Version == 15 {
convertV15V16(cfg)
}
if cfg.Version == 16 {
convertV16V17(cfg)
}
// Build a list of available devices
existingDevices := make(map[protocol.DeviceID]bool)
@@ -327,6 +330,14 @@ func convertV15V16(cfg *Configuration) {
cfg.Version = 16
}
func convertV16V17(cfg *Configuration) {
for i := range cfg.Folders {
cfg.Folders[i].Fsync = true
}
cfg.Version = 17
}
func convertV13V14(cfg *Configuration) {
// Not using the ignore cache is the new default. Disable it on existing
// configurations.