forked from TrueCloudLab/frostfs-node
Evgenii Stratonikov
7f692409cf
Metabase test relied on this behaviour, so fix the test too. Cherry-picking was hard and did too many conflicts, here is an original PR: https://github.com/nspcc-dev/neofs-node/pull/2624 Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
33 lines
636 B
Go
33 lines
636 B
Go
package fstree
|
|
|
|
import (
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util"
|
|
)
|
|
|
|
// Open implements common.Storage.
|
|
func (t *FSTree) Open(ro bool) error {
|
|
t.readOnly = ro
|
|
t.metrics.SetMode(ro)
|
|
return nil
|
|
}
|
|
|
|
// Init implements common.Storage.
|
|
func (t *FSTree) Init() error {
|
|
if err := util.MkdirAllX(t.RootPath, t.Permissions); err != nil {
|
|
return err
|
|
}
|
|
if !t.readOnly {
|
|
f := newSpecificWriteData(t.fileCounter, t.RootPath, t.Permissions, t.noSync)
|
|
if f != nil {
|
|
t.writeData = f
|
|
}
|
|
}
|
|
|
|
return t.initFileCounter()
|
|
}
|
|
|
|
// Close implements common.Storage.
|
|
func (t *FSTree) Close() error {
|
|
t.metrics.Close()
|
|
return nil
|
|
}
|