[#1992] fstree: Allow working in SYNC mode

Make O_SYNC the default and allow to opt-out explicitly.

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-10-28 12:57:36 +03:00 committed by fyrchik
parent 694d888219
commit f564430b90
2 changed files with 32 additions and 2 deletions

View file

@ -29,3 +29,9 @@ func WithPath(p string) Option {
f.RootPath = p
}
}
func WithNoSync(noSync bool) Option {
return func(f *FSTree) {
f.noSync = noSync
}
}