frostfs-node/pkg/local_object_storage/blobstor/fstree/control.go
Dmitrii Stepanov 58c8722c81 [#585] fstree: Add optional file counter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-08-16 14:47:44 +03:00

26 lines
495 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
}
return t.initFileCounter()
}
// Close implements common.Storage.
func (t *FSTree) Close() error {
t.metrics.Close()
return nil
}