frostfs-node/pkg/local_object_storage/blobstor/fstree/control.go
Dmitrii Stepanov 7429553266
[#1437] node: Fix contextcheck linter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2024-11-13 10:36:10 +03:00

36 lines
775 B
Go

package fstree
import (
"context"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util"
)
// Open implements common.Storage.
func (t *FSTree) Open(mode mode.ComponentMode) error {
t.readOnly = mode.ReadOnly()
t.metrics.SetMode(mode)
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.writer = f
}
}
return t.initFileCounter()
}
// Close implements common.Storage.
func (t *FSTree) Close(_ context.Context) error {
t.metrics.Close()
return nil
}