2022-07-08 11:33:49 +00:00
|
|
|
package fstree
|
|
|
|
|
2022-07-11 12:34:17 +00:00
|
|
|
import (
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util"
|
2022-07-11 12:34:17 +00:00
|
|
|
)
|
|
|
|
|
2022-07-08 11:33:49 +00:00
|
|
|
// Open implements common.Storage.
|
2022-08-23 13:04:01 +00:00
|
|
|
func (t *FSTree) Open(ro bool) error {
|
|
|
|
t.readOnly = ro
|
2023-06-02 13:04:02 +00:00
|
|
|
t.metrics.SetMode(ro)
|
2022-08-23 13:04:01 +00:00
|
|
|
return nil
|
|
|
|
}
|
2022-07-08 11:33:49 +00:00
|
|
|
|
|
|
|
// Init implements common.Storage.
|
2022-07-11 12:34:17 +00:00
|
|
|
func (t *FSTree) Init() error {
|
2023-08-11 08:32:43 +00:00
|
|
|
if err := util.MkdirAllX(t.RootPath, t.Permissions); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return t.initFileCounter()
|
2022-07-11 12:34:17 +00:00
|
|
|
}
|
2022-07-08 11:33:49 +00:00
|
|
|
|
|
|
|
// Close implements common.Storage.
|
2023-06-02 13:04:02 +00:00
|
|
|
func (t *FSTree) Close() error {
|
|
|
|
t.metrics.Close()
|
|
|
|
return nil
|
|
|
|
}
|